Skip to main content
Tell an Orgo computer what to do in plain English. The AI sees the screen, clicks, types, and runs commands until the task is done. Uses the standard OpenAI SDK — no new libraries to learn.
from openai import OpenAI
from orgo import Computer

computer = Computer()

client = OpenAI(
    base_url="https://api.orgo.ai/api/v1",
    api_key="sk_live_..."  # Your Orgo API key
)

response = client.chat.completions.create(
    model="claude-sonnet-4.6",
    messages=[{"role": "user", "content": "Open Firefox and search for AI news"}],
    extra_body={"computer_id": computer.computer_id},
)

print(response.choices[0].message.content)

Streaming

stream = client.chat.completions.create(
    model="claude-sonnet-4.6",
    messages=[{"role": "user", "content": "Open Firefox and search for AI news"}],
    extra_body={"computer_id": computer.computer_id},
    stream=True,
)

for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Multi-turn

Pass thread_id from a previous response to continue where you left off:
response = client.chat.completions.create(
    model="claude-sonnet-4.6",
    messages=[{"role": "user", "content": "Open Firefox and go to github.com"}],
    extra_body={"computer_id": computer.computer_id},
)
thread_id = response.orgo["thread_id"]

# The AI remembers it already opened Firefox
response2 = client.chat.completions.create(
    model="claude-sonnet-4.6",
    messages=[{"role": "user", "content": "Search for 'orgo'"}],
    extra_body={"computer_id": computer.computer_id, "thread_id": thread_id},
)

Bring your own key

Use your own Anthropic API key — no Orgo credits consumed:
curl https://api.orgo.ai/api/v1/chat/completions \
  -H "Authorization: Bearer sk_live_..." \
  -H "X-Anthropic-Key: sk-ant-..." \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-4.6","computer_id":"...","messages":[{"role":"user","content":"Open Firefox"}]}'

Reference

Endpoint

POST https://api.orgo.ai/api/v1/chat/completions
Auth: Authorization: Bearer sk_live_...

Request body

FieldTypeRequiredDescription
modelstringNoclaude-sonnet-4.6 (default) or claude-opus-4.6
messagesarrayYes[{role, content}] — same format as OpenAI
computer_idstringYesID of a running Orgo computer
streambooleanNoStream response as SSE (default: false)
thread_idstringNoContinue a previous session
max_stepsnumberNoMax agent steps (default: 100)

Response

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "model": "claude-sonnet-4.6",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Done. Firefox is open with AI news search results."
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 1200,
    "completion_tokens": 340,
    "total_tokens": 1540
  },
  "orgo": {
    "thread_id": "thr_abc123",
    "steps": 8
  }
}

Streaming format

Standard OpenAI SSE:
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","choices":[{"delta":{"content":"Opening Firefox..."},"index":0,"finish_reason":null}]}

data: [DONE]

Models

ModelDescription
claude-sonnet-4.6Fast, cost-effective (default)
claude-opus-4.6Most capable, best for complex tasks

Errors

StatusCodeMeaning
401invalid_api_keyInvalid or missing API key
402credits_exhaustedAdd credits at orgo.ai/settings/billing
400missing_computer_idcomputer_id is required
400invalid_modelUse claude-sonnet-4.6 or claude-opus-4.6
404computer_not_foundComputer not found or you don’t have access