Create chat completion
Run an agent on a computer with one OpenAI-compatible request: models and the Computer Use default, images, step limits, streaming, billing, and every error.
https://www.orgo.ai/api/v1 and add computer_id to the request.
Quick start
Set$ORGO_API_KEY to your API key and $COMPUTER_ID to the id of a running computer, from Create computer.
model, so the SDK examples name orgo-agent. With cURL you can leave model out and get the default, described in Choose a model.
Choose a model
model is optional. Leave it out and Orgo picks one for the computer:
model field names the model that ran.
400 invalid_model, and the message lists the accepted values. Naming orgo-agent or orgo-agent-opus-5.5 for an Android computer returns 400 model_unsupported_os.
claude-opus-5.5). Anthropic’s own API uses a hyphen (claude-opus-5-5). Use the hyphenated form only when you call Anthropic directly, as in the Claude Computer Use guide.Request body
id from Create computer) or its instance id. You need write access to its workspace. Omitted, the request returns 400 missing_computer_id.{ role, content } objects. content is a string or an array of content parts, described in Send text and images.Messages with a role other than user or assistant, such as system, are dropped. The first remaining message must be from the user, or the request returns 400 invalid_message_order. No remaining message returns 400 empty_messages.The server does not load earlier turns from a thread. Resend the full transcript on every request, described in Threads and history.orgo-agent, orgo-agent-opus-5.5, claude-sonnet-5, claude-opus-5.5, claude-opus-5, claude-opus-4.8, claude-sonnet-4.6, or claude-opus-4.6. Optional. Omitted, the request runs orgo-agent, or claude-sonnet-5 on an Android computer or when you send x-anthropic-key. See Choose a model.true streams the answer as Server-Sent Events, described in Streaming. Omitted or false, the response is one JSON body sent when the run ends.orgo.thread_id and the X-Thread-Id header. A thread_id that is not a UUID or does not exist is ignored, and a new thread is created. So is another user’s chat about a computer in a workspace you can reach, and, with a workspace-scoped key, a thread in its workspace that is not on this computer. A thread in a workspace you can’t reach, or another user’s chat that is not about a computer, is refused with 403 before the run, as described in Errors. It does not change what the model sees. See Threads and history.Headers
Bearer $ORGO_API_KEY. An account-wide key reaches every computer your account can. A workspace-scoped key reaches only computers in its own workspace. Get a key at orgo.ai/settings/credentials.claude-* model and orgo-agent-opus-5.5. The run is then billed to your Anthropic account, not to Orgo credits, and orgo.cost_cents is 0. With orgo-agent it is ignored and the run bills to Orgo credits. With no model, sending it runs claude-sonnet-5.Send text and images
content is a plain string, or an array of OpenAI content parts:
url is an https:// URL, or a base64 data URL of a PNG, JPEG, GIF, or WebP image (data:image/png;base64,…). Both forms work with every model. Orgo passes an https:// URL to the model provider, which fetches the image itself, so the URL must be publicly reachable.
400 invalid_messages. The param field names the part that failed:
param counts every message you sent, including dropped ones.
Step limits
A step is one model call and the computer actions it makes. A run takes at most 250 steps. Sendmax_steps to allow up to 500.
A run that reaches its limit stops and returns normally, with:
finish_reasonset to"length"instead of"stop".- A final assistant message that ends with
Stopped after N steps. Send a message to keep going.
finish_reason "stop". Its final message depends on the model: Out of AI credits. The run was stopped. for orgo-agent models, and The run stopped here because the AI credit balance ran out. Top up and send a follow-up to continue. for claude-* models.
Response
chatcmpl- followed by a 16-character opaque id. Also sent as the X-Request-Id header. Include it when you report a problem.chat.completion.model in the request, orgo-agent or claude-sonnet-5.Streaming
With"stream": true the response is text/event-stream. Each event is an OpenAI chat.completion.chunk, and the stream ends with data: [DONE]:
- Only text streams. Screenshots, clicks, and commands run on Orgo’s side and are not sent.
- The last chunk carries
finish_reason("stop"or"length") andusage. - No
orgoblock. Read the thread ID from theX-Thread-Idheader, which arrives before the first chunk. - Closing the connection stops the run at its next step. Steps already taken are billed.
Errors during a stream
The status is already200 when the run starts, so a failure mid-run cannot change it. The stream sends one error event and ends:
APIError. If you read the stream yourself, treat a stream that ends without a chunk carrying finish_reason as failed.
A run that fails mid-stream is billed for the tokens it used before failing. Its hold is refunded only when it used none.
Threads and history
[image]. To read or manage stored threads, see Threads.
Bring your own Anthropic key
Sendx-anthropic-key to pay for an Anthropic-served model on your own Anthropic account. No Orgo credits are held or spent, and orgo.cost_cents is 0.
orgo-agent runs on OpenAI’s GPT-6 Astra, so an Anthropic key cannot pay for it. A request that names orgo-agent bills to Orgo credits even when the header is sent.
Billing
Runs draw on the AI credits of the computer’s workspace owner, not the caller.- Rates. A run costs the model provider’s list price for the tokens it used, plus 10%. Credits are charged to a fraction of a cent.
orgo.cost_centsreports that cost rounded up to a whole cent, and is at least 1. - Computer Use.
orgo-agentruns GPT-6 Astra on its fast tier, which bills at twice Astra’s standard rates.orgo-agent-opus-5.5runs Claude Opus 5.5 at standard rates. - Hold and settle. A flat hold is placed when the request starts. It is settled against actual usage after the response is sent, so
orgo.credit_balance_centsreflects the hold, not the final cost. - Budget. The run stops early when its running cost comes within 25 cents of the balance available at the start. When a workspace member’s request spends the owner’s credits, that request may use at most $5.
- No hold is placed when
x-anthropic-keypays, or on Enterprise.
Errors
type is one of invalid_request, authentication_error, insufficient_credits, permission_error, not_found, or server_error. Branch on code. invalid_messages adds param, and 402 adds balance_cents.
Once a stream has started, failures arrive as an error event instead of a status, described in Errors during a stream.Authorizations
API key authentication. Get your key at orgo.ai/workspaces
Headers
Your own Anthropic API key. Pays for Anthropic-served models only (claude-* and orgo-agent-opus-5.5): the run is then not billed to Orgo credits. Ignored for orgo-agent. When model is omitted, sending it runs claude-sonnet-5.
Body
The computer to drive: its UUID or its instance id. You need write access to its workspace.
The whole conversation. Roles other than user and assistant are dropped. The first remaining message must be from the user.
Omit to get the default: orgo-agent on Linux, Windows, macOS, and iPhone computers, claude-sonnet-5 on Android computers or when x-anthropic-key is sent. A named model always runs that model. orgo-agent and orgo-agent-opus-5.5 do not run on Android computers.
orgo-agent, orgo-agent-opus-5.5, claude-sonnet-5, claude-opus-5.5, claude-opus-5, claude-opus-4.8, claude-sonnet-4.6, claude-opus-4.6 Stream the answer as chat.completion.chunk Server-Sent Events, ending in data: [DONE].
Raise the step limit. Values above 500 are capped at 500, values below 250 run with 250, and a value that is not a number is ignored (250). Never an error.
A thread to write this turn into. It does not load history. An unknown or non-UUID id, a thread that isn't yours, or, with a workspace-scoped key, a thread on another computer is ignored and a new thread starts.
Response
The final answer. With stream: true, a text/event-stream of chat.completion.chunk events instead.