openai.chat.completions.create.
The response is wire-compatible with OpenAI’s chat completions. Any SDK that points at
https://www.orgo.ai/api/v1 works unchanged. The only required extension is passing a computer_id to bind the agent to a running computer.Endpoint
Authorization: Bearer $ORGO_API_KEY
Request
string
required
Identifier of a running Orgo computer: either its UUID (the
id field from Create computer) or its instance id. The authenticated user must own the computer or be a member of its workspace. Omitting it returns 400 missing_computer_id.array
required
Array of
{ role, content } objects, where content is a plain string. Messages whose role is neither user nor assistant are dropped, and the first surviving message must have role user. An array with no usable message returns 400 empty_messages.The server does not load history from a thread, so a multi-turn conversation must resend the full transcript on every request. See Threads and history.string
default:"claude-sonnet-5"
Model identifier. Exactly one of
claude-sonnet-5, claude-opus-5, claude-opus-4.8, claude-sonnet-4.6, or claude-opus-4.6. Anything else returns 400 invalid_model. When omitted, claude-sonnet-5 is used. See Models below.boolean
default:"false"
If
true, responses are streamed as OpenAI-format Server-Sent Events. The connection stays open until the agent finishes or the client aborts the request. When omitted or false, the server buffers the whole agent run and returns a single JSON body.string
UUID of a thread to record this turn against. When omitted, a new thread is created and its ID is returned in
orgo.thread_id. A thread_id that does not exist, or that belongs to another user, is ignored without error and a new thread is created instead.This selects where messages are written. It does not affect what the model sees. See Threads and history.max_steps is not currently supported. The endpoint ignores any value you send, and the agent loop runs to a fixed internal ceiling of 250 steps.Headers
string
required
Bearer $ORGO_API_KEY, your Orgo API key. Get one at orgo.ai/settings/credentials.string
Bring-your-own Anthropic key. When present, inference bills directly to your Anthropic account, no Orgo credit hold is placed, and
orgo.cost_cents is 0. When absent, the request draws from the Orgo credit balance of the computer’s workspace owner.Threads and history
Response
Non-streaming
string
Request identifier (
chatcmpl- followed by a 16-character opaque id). Also returned as the X-Request-Id response header.string
Always
chat.completion.integer
Unix timestamp (seconds).
string
The model ID you requested, echoed verbatim.
array
Single-element array containing the final assistant message.
object
Token counts for the full agent loop (all intermediate turns, not only the final message).
object
Orgo-specific metadata not in the OpenAI spec.
Response headers
Streaming
Whenstream: true, the server returns text/event-stream with standard OpenAI chat.completion.chunk events:
orgo metadata block is not sent on this path. Read X-Thread-Id from the response headers instead, which are set before the first chunk arrives.
Errors during a stream
The HTTP status is committed as 200 before the agent runs, so a mid-run failure cannot change it. Instead the stream emits a single error frame and terminates:finish_reason: "stop" chunk as failed.
Examples
Streaming with raw SSE
Continuing a conversation
Keep the transcript yourself and resend it in full. Pass thethread_id from the first response so both turns land in the same stored thread.
Bring your own Anthropic key
Passx-anthropic-key to bill inference against your own Anthropic account. Orgo credits are not held or consumed and orgo.cost_cents is 0.
Example response
Models
Per-model rates are on the pricing page.
Orgo’s OpenAI-compatible endpoint uses dotted model IDs for prior generations (
claude-sonnet-4.6). If you call Anthropic’s native SDK directly, as in the Claude Computer Use guide, use the hyphenated form (claude-sonnet-4-6). That is Anthropic’s canonical identifier.Billing
Requests draw on the credit balance of the computer’s workspace owner, not the caller. Orgo places a flat credit hold at request start and settles it against actual token usage once the agent loop finishes. Settlement is deferred until after the response is sent, so the balance reported inorgo.credit_balance_cents reflects the hold rather than the final cost.
Holds are skipped entirely for BYOK requests and for enterprise plans. Rates are on the pricing page; the computed cost of a single request is returned in orgo.cost_cents.
Errors
Every error response has the shape:
type is one of invalid_request, authentication_error, insufficient_credits, permission_error, not_found, or server_error.
Once a streaming response has started, failures arrive as an SSE error frame rather than an HTTP status. See Errors during a stream.