{"openapi":"3.1.0","info":{"title":"OpenAgents API","version":"1.0.0-beta","summary":"One API for many models: Open Responses and OpenAI Chat Completions, routed to a good provider, at the provider's price plus a posted margin.","description":"Send `Authorization: Bearer oak_...` with a key from Settings. This server takes no payment per request; send an API key. Guides: https://openagents.com/docs/api; for agents: https://openagents.com/docs/api/for-agents. Command line: `openagents inference`.","license":{"name":"CC0-1.0","identifier":"CC0-1.0"}},"servers":[{"url":"http://api.openagents.com/v1"}],"tags":[{"name":"Inference","description":"Generate text, with or without streaming."},{"name":"Catalog","description":"Models and prices; no key needed."},{"name":"Account","description":"Usage, keys, and the limits you set."},{"name":"Decisions","description":"Typed answers: probabilities, choices, and scores, without generated text."},{"name":"Workspaces","description":"Workspaces, members, invitations, and single sign-on."},{"name":"Agents","description":""},{"name":"Usage","description":"What the workspace spent, its balance, and top-ups."}],"paths":{"/responses":{"post":{"operationId":"createResponse","summary":"Create a response (Open Responses).","tags":["Inference"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResponse"}}}},"responses":{"200":{"description":"The answer: JSON, or server-sent events ending with `data: [DONE]` when `stream` is true.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"},"x-openagents-model":{"description":"The model that answered.","schema":{"type":"string"}},"x-openagents-upstream":{"description":"The provider that answered.","schema":{"type":"string"}},"x-openagents-cost-usd":{"description":"What the answer cost, in dollars (not on streams; see the openagents:cost event).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}},"text/event-stream":{"schema":{"type":"string","description":"Open Responses events (`response.created`, deltas, `response.completed`), plus `openagents:route` and `openagents:cost`."}}}},"402":{"description":"Pay first. With a key: `insufficient_balance`; add credit. With no key this server answers `401`: it takes no payment per request.","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredBody"}}}},"400":{"description":"The request is not valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"A limit the key's owner set (`limit_reached`, named in `param`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No such model (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"502":{"description":"Every provider failed before answering (`upstream_failed`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"No provider meets the request's constraints (`no_route`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"get":{"operationId":"responsesWebSocket","summary":"Open Responses over a WebSocket: upgrade, then send `response.create` messages.","tags":["Inference"],"security":[{"bearer":[]}],"responses":{"101":{"description":"Switching protocols."},"401":{"description":"No key, or the key was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/chat/completions":{"post":{"operationId":"createChatCompletion","summary":"Create a chat completion (OpenAI Chat Completions).","tags":["Inference"],"security":[{"bearer":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"The answer: JSON, or server-sent events ending with `data: [DONE]` when `stream` is true.","headers":{"x-request-id":{"$ref":"#/components/headers/RequestId"},"x-openagents-model":{"description":"The model that answered.","schema":{"type":"string"}},"x-openagents-upstream":{"description":"The provider that answered.","schema":{"type":"string"}},"x-openagents-cost-usd":{"description":"What the answer cost, in dollars (not on streams; see the openagents:cost event).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}},"text/event-stream":{"schema":{"type":"string","description":"Chat Completions chunks (`chat.completion.chunk`)."}}}},"402":{"description":"Pay first. With a key: `insufficient_balance`; add credit. With no key this server answers `401`: it takes no payment per request.","headers":{},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredBody"}}}},"400":{"description":"The request is not valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"A limit the key's owner set (`limit_reached`, named in `param`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No such model (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"502":{"description":"Every provider failed before answering (`upstream_failed`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"No provider meets the request's constraints (`no_route`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/decisions":{"post":{"operationId":"createDecision","summary":"Typed decisions (OpenAI Decisions): the probability a condition is true, one choice from a set, or a score against ordered levels. No key needed; free.","description":"One NIP-DEC decision underneath (docs/api/decisions.md). `openagents/decide` asks our hosted Clef first, then the backups; `clef-flash` and `clef` ask only our hosted Clef. `X-Decision-Order: pylon` asks connected Pylons first; `hosted` asks only our hosted Clef.","tags":["Decisions"],"security":[{},{"bearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"The same key and body within 24 hours returns the first answer; a different body is 409 `idempotency_conflict`."},{"name":"X-Decision-Order","in":"header","required":false,"schema":{"type":"string","enum":["pylon","hosted"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDecision"}}}},"responses":{"200":{"description":"The answers, one per question in request order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Decision"}}}},"400":{"description":"The request is not valid (`invalid_request`, `too_many_questions`, `too_many_options`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"No such decision model (`model_not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"409":{"description":"The Idempotency-Key was used with another body (`idempotency_conflict`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"413":{"description":"Over a bound (`limit_exceeded`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"503":{"description":"No decision door could answer right now (`unavailable`); retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/responses/compact":{"post":{"operationId":"compactResponse","summary":"Compact a conversation: your messages plus one sealed summary item.","tags":["Inference"],"security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResponse"}}}},"responses":{"200":{"description":"The compacted input.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Compaction"}}}},"400":{"description":"The request is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/responses/{id}":{"get":{"operationId":"getResponse","summary":"A stored response (`store: true`).","tags":["Inference"],"security":[{"bearer":[]}],"responses":{"200":{"description":"A stored response (`store: true`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}},"404":{"description":"No stored response with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"The response id, `resp_...`.","schema":{"type":"string"}}]},"delete":{"operationId":"deleteResponse","summary":"Delete a stored response now.","tags":["Inference"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Delete a stored response now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"404":{"description":"No stored response with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"id","in":"path","required":true,"description":"The response id, `resp_...`.","schema":{"type":"string"}}]}},"/models":{"get":{"operationId":"listModels","summary":"Every model, its providers, capabilities, prices, and live speed. OpenAI's list shape plus an `openagents` object per model.","tags":["Catalog"],"security":[{},{"bearer":[]}],"responses":{"200":{"description":"The catalog.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}}}}},"/usage/tokens-served":{"get":{"operationId":"tokensServed","summary":"Reported tokens served, total and per UTC day, split by caller and price tier.","tags":["Catalog"],"security":[{}],"responses":{"200":{"description":"Token totals since counting began. Own-key calls are included in paid calls.","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"description":"Token totals are unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/rates":{"get":{"operationId":"getRates","summary":"The rate card: one row per model and provider, with the provider's price, our margin, and the sum, per million tokens.","tags":["Catalog"],"security":[{}],"responses":{"200":{"description":"The rate card.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateCard"}}}}}}},"/usage/{request_id}":{"get":{"operationId":"getUsage","summary":"One finished request: tokens, cost, provider, attempts, and what was charged.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"One finished request: tokens, cost, provider, attempts, and what was charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageView"}}}},"404":{"description":"No request with that id for this key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"request_id","in":"path","required":true,"description":"The `x-request-id` of the request, `req_...`.","schema":{"type":"string"}}]}},"/key":{"get":{"operationId":"getKey","summary":"The calling key: its balance, spend, and the limits its owner set.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"The calling key: its balance, spend, and the limits its owner set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyView"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/workspaces/{workspace}/keys/{key}/limits":{"get":{"operationId":"getKeyLimits","summary":"The limits a key's owner set on it.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"The limits a key's owner set on it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Limits"}}}},"403":{"description":"Not the key's owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"key","in":"path","required":true,"description":"The key id.","schema":{"type":"string"}}]},"put":{"operationId":"setKeyLimits","summary":"Set a key's limits: spending cap, price cap, models, requests a minute, expiry. Only the owner's session, never the key itself.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Set a key's limits: spending cap, price cap, models, requests a minute, expiry. Only the owner's session, never the key itself.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Limits"}}}},"400":{"description":"A limit is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not the key's owner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"key","in":"path","required":true,"description":"The key id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Limits"}}}}}},"/workspaces/{workspace}/keys":{"get":{"operationId":"listKeys","summary":"The workspace's API keys (never their secrets).","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"The workspace's API keys (never their secrets).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyList"}}}},"403":{"description":"Not a member of the workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}]},"post":{"operationId":"issueKey","summary":"Make an API key. The secret is shown once.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Make an API key. The secret is shown once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedKey"}}}},"403":{"description":"Not allowed to make keys here.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"So you can tell your keys apart."},"scopes":{"type":"array","items":{"type":"string","enum":["responses","models:read","usage:read","traces","traces:read","threads","threads:read","runs","runs:read","plugins","keys","billing","workspace"]},"description":"What the key may do. Left out: `responses`, `models:read`, `usage:read`. Scopes only narrow; a key can never change its own scopes or limits."}}}}}}}},"/workspaces/{workspace}/keys/{key}":{"delete":{"operationId":"revokeKey","summary":"Revoke a key now.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Revoke a key now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"404":{"description":"No such key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"key","in":"path","required":true,"description":"The key id.","schema":{"type":"string"}}]}},"/workspaces/{workspace}/provider-keys":{"get":{"operationId":"listProviderKeys","summary":"The workspace's own provider keys: provider and fingerprint, never the key. Requests with `openagents.pay: \"mine\"` run on them.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"The workspace's own provider keys: provider and fingerprint, never the key. Requests with `openagents.pay: \"mine\"` run on them.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderKeyList"}}}},"403":{"description":"Not the workspace's owner or an admin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}]}},"/workspaces/{workspace}/provider-keys/{provider}":{"put":{"operationId":"setProviderKey","summary":"Add or replace the workspace's own key for a provider. Sealed at rest; never answered back.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Add or replace the workspace's own key for a provider. Sealed at rest; never answered back.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderKey"}}}},"400":{"description":"Not a key for that provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not the workspace's owner or an admin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"provider","in":"path","required":true,"description":"`openrouter`, `vercel`, `anthropic`, `openai`, or `google`.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key"],"properties":{"key":{"type":"string"}}}}}}},"delete":{"operationId":"deleteProviderKey","summary":"Remove the workspace's own key for a provider.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Remove the workspace's own key for a provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"403":{"description":"Not the workspace's owner or an admin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key, or the key was rejected (`unauthorized`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"provider","in":"path","required":true,"description":"`openrouter`, `vercel`, `anthropic`, `openai`, or `google`.","schema":{"type":"string"}}]}},"/openapi.json":{"get":{"operationId":"getOpenApi","summary":"This document.","tags":["Catalog"],"security":[{}],"responses":{"200":{"description":"OpenAPI 3.1.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/account":{"get":{"operationId":"getAccount","summary":"Your account.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/account/access":{"get":{"operationId":"getAccountAccess","summary":"What you may do, per workspace.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/workspaces/{workspace}/keys/{key}/copy":{"post":{"operationId":"copyKey","summary":"Make a new key with the same scopes and limits as this one. The secret is shown once.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"key","in":"path","required":true,"description":"The key id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/keys/{key}/pause":{"post":{"operationId":"pauseKey","summary":"Pause a key; its calls are refused until it is resumed.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"key","in":"path","required":true,"description":"The key id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/keys/{key}/resume":{"post":{"operationId":"resumeKey","summary":"Resume a paused key.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"key","in":"path","required":true,"description":"The key id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/keys/{key}/rotate":{"post":{"operationId":"rotateKey","summary":"Replace a key's secret. The new secret is shown once.","tags":["Account"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"key","in":"path","required":true,"description":"The key id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces":{"post":{"operationId":"createWorkspace","summary":"Make a workspace.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}":{"get":{"operationId":"getWorkspace","summary":"A workspace and its members.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}]},"patch":{"operationId":"updateWorkspace","summary":"Rename a workspace.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/invitations":{"post":{"operationId":"inviteMember","summary":"Invite someone to the workspace.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/invitations/{invitation}":{"delete":{"operationId":"revokeInvitation","summary":"Take an invitation back.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"invitation","in":"path","required":true,"description":"The invitation id.","schema":{"type":"string"}}]}},"/invitations/accept":{"post":{"operationId":"acceptInvitation","summary":"Join a workspace with an invitation.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/invitations/accept-reviewed":{"post":{"operationId":"acceptReviewedInvitation","summary":"Join a workspace with an invitation, after reviewing its terms.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/members/{account}":{"patch":{"operationId":"setMemberRole","summary":"Change a member's role.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"account","in":"path","required":true,"description":"The account id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}},"delete":{"operationId":"removeMember","summary":"Remove a member.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"account","in":"path","required":true,"description":"The account id.","schema":{"type":"string"}}]}},"/workspaces/{workspace}/transfer":{"post":{"operationId":"transferWorkspace","summary":"Give the workspace to another member.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/access":{"get":{"operationId":"getWorkspaceAccess","summary":"Who may do what in the workspace.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}]}},"/workspaces/{workspace}/team-policy":{"get":{"operationId":"getTeamPolicy","summary":"The workspace's team rules.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}]},"put":{"operationId":"setTeamPolicy","summary":"Set the workspace's team rules.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/sso":{"get":{"operationId":"getSso","summary":"The workspace's single sign-on provider.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}]},"put":{"operationId":"setSso","summary":"Set the workspace's single sign-on provider.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/sso/links":{"post":{"operationId":"linkSso","summary":"Link a member to a single sign-on identity.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/sso/unlink":{"post":{"operationId":"unlinkSso","summary":"Unlink a member's single sign-on identity.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/sso/sign-in":{"post":{"operationId":"signInSso","summary":"Sign in through the workspace's single sign-on provider.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/sso/audit":{"get":{"operationId":"getSsoAudit","summary":"Single sign-on events.","tags":["Workspaces"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}]}},"/agents/challenge":{"get":{"operationId":"getAgentChallenge","summary":"A proof-of-work challenge for registering an agent, good for ten minutes.","tags":["Agents"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/agents/register":{"post":{"operationId":"registerAgent","summary":"An agent registers itself with a solved challenge: an agent account and an API key (shown once), a claim code, the free tier, and how to pay.","tags":["Agents"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/agents/me":{"get":{"operationId":"getAgent","summary":"The calling agent: its free tier today, its credit, and how to pay.","tags":["Agents"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/agents/claim":{"post":{"operationId":"claimAgent","summary":"A signed-in person links an agent to their account with its claim code.","tags":["Agents"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/agents/claimed":{"get":{"operationId":"listClaimedAgents","summary":"The signed-in person's agents.","tags":["Agents"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/agents/{account}/revoke":{"post":{"operationId":"revokeAgent","summary":"The person who claimed an agent, or a site admin, revokes it; its key stops at once.","tags":["Agents"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"account","in":"path","required":true,"description":"The account id.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/agents/credit":{"post":{"operationId":"creditAgent","summary":"The pay host adds bought credit to an agent after a Lightning payment (signed header only).","tags":["Agents"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/workspaces/{workspace}/usage":{"get":{"operationId":"getWorkspaceUsage","summary":"The workspace's usage, totaled.","tags":["Usage"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}]}},"/workspaces/{workspace}/usage/activity":{"get":{"operationId":"listWorkspaceActivity","summary":"The workspace's calls, newest first (`data`, `next`, `?after=`).","tags":["Usage"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}]}},"/workspaces/{workspace}/usage/timeseries":{"get":{"operationId":"getWorkspaceTimeseries","summary":"The workspace's usage over time.","tags":["Usage"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}]}},"/workspaces/{workspace}/usage/receipts/{digest}":{"get":{"operationId":"getReceipt","summary":"One execution receipt.","tags":["Usage"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}},{"name":"digest","in":"path","required":true,"description":"The digest id.","schema":{"type":"string"}}]}},"/workspaces/{workspace}/usage/export":{"get":{"operationId":"exportWorkspaceUsage","summary":"The workspace's usage as a file.","tags":["Usage"],"security":[{"bearer":[]}],"responses":{"200":{"description":"Done.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request isn't valid (`invalid_request`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"401":{"description":"No key or session, or it was rejected (`authentication`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"403":{"description":"Not allowed here (`permission`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}},"404":{"description":"Nothing with that id here (`not_found`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":[{"name":"workspace","in":"path","required":true,"description":"The workspace id.","schema":{"type":"string"}}]}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"oak_<id>.<secret>","description":"An API key from Settings. Requests draw on the account's credit, or the free tier on free models."}},"headers":{"RequestId":{"description":"Our id for the request; `GET /v1/usage/{request_id}` reads it.","schema":{"type":"string"}}},"schemas":{"Error":{"type":"object","required":["type","message"],"properties":{"type":{"type":"string","examples":["invalid_request","unauthorized","insufficient_balance","payment_required","limit_reached","not_found","too_many_requests","server_error","model_error","upstream_failed","no_route"]},"code":{"type":["string","null"]},"param":{"type":["string","null"]},"message":{"type":"string"},"request_id":{"type":"string","description":"The answer's `x-request-id`."}}},"CreateDecision":{"type":"object","required":["model","input","questions"],"properties":{"model":{"type":"string","examples":["openagents/decide","clef-flash","clef","jev-latest"]},"input":{"description":"The shared evidence: a string, or user messages whose content is a string or `input_text` / `input_image` (base64 data URL) parts.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"questions":{"type":"array","minItems":1,"maxItems":64,"items":{"type":"object","required":["type","instructions"],"properties":{"type":{"type":"string","enum":["predicate","choice","score"]},"name":{"type":"string","minLength":1,"maxLength":64},"instructions":{"type":"string"},"choices":{"type":"array","minItems":2,"maxItems":255,"items":{"type":"object","required":["value"],"properties":{"value":{"type":"string"},"description":{"type":"string"}}}},"levels":{"type":"array","minItems":2,"maxItems":10,"items":{"type":"object","required":["label"],"properties":{"label":{"type":"string"},"description":{"type":"string"}}}},"true":{"type":"string"},"false":{"type":"string"}}}},"metadata":{"type":"object","maxProperties":16,"additionalProperties":{"type":"string"}}}},"Decision":{"type":"object","required":["id","object","model","answers","usage"],"properties":{"id":{"type":"string","description":"`dec_` and an opaque id."},"object":{"type":"string","const":"decision"},"model":{"type":"string","description":"The model that answered."},"answers":{"type":"array","items":{"type":"object","required":["type","name"],"properties":{"type":{"type":"string","enum":["predicate","choice","score","refusal"]},"name":{"type":"string"},"probability":{"type":"number"},"choice":{"type":"string"},"score":{"type":"number"},"probabilities":{"type":"array","items":{"type":"object"}},"confidence":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}}}},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"cached_input_tokens":{"type":"integer"}}},"metadata":{"type":"object"},"openagents":{"type":"object","properties":{"door":{"type":["string","null"],"description":"`clef`, `pylon:<slug>`, `jev`, or `vertex`."},"backend":{"type":"string","description":"For `clef`: the machine that answered (`h100`, `a100`); also the `X-Decision-Backend` header."},"latency_ms":{"type":"integer"},"cost":{"type":"object"},"receipt":{"type":"string"}}}}},"ErrorBody":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/Error"}}},"PaymentRequiredBody":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/Error"},"x402Version":{"type":"integer","const":2},"price_sats":{"type":"integer","description":"The most this request can cost, in sats."},"price_msat":{"type":"string"},"price_usd":{"type":"string","description":"The same, in dollars."},"reason":{"type":"string","description":"Why a payment was refused (x402 errorReason)."},"methods":{"type":"array","description":"The live payment methods, in challenge order.","items":{"type":"object"}},"challengeId":{"type":"string","description":"The `Payment` challenge's id, when that method is live."},"docs":{"type":"string","description":"How to pay."}}},"CreateResponse":{"type":"object","description":"An Open Responses request (https://www.openresponses.org/reference), plus the optional `openagents` object.","required":["model"],"properties":{"model":{"type":"string","description":"A model id such as `google/gemini-3.8-flash`, or a task class: `openagents/auto`, `openagents/chat`, `openagents/fast`, `openagents/code`, `openagents/long`, `openagents/reason`, `openagents/classify`."},"input":{"description":"Text, or a list of items.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"instructions":{"type":"string"},"tools":{"type":"array","items":{"type":"object"}},"tool_choice":{},"max_output_tokens":{"type":"integer","minimum":1},"temperature":{"type":"number"},"top_p":{"type":"number"},"reasoning":{"type":"object"},"text":{"type":"object"},"stream":{"type":"boolean"},"store":{"type":"boolean","description":"Keep the response (sealed, 30 days) so `previous_response_id` can continue it. Needs a key."},"previous_response_id":{"type":"string"},"metadata":{"type":"object"},"openagents":{"$ref":"#/components/schemas/RequestOptions"}}},"RequestOptions":{"type":"object","properties":{"privacy":{"type":"string","enum":["strict","standard"],"description":"`strict` (default): only providers that keep nothing and train on nothing."},"max_price":{"type":"object","properties":{"input":{"type":"string"},"output":{"type":"string"}},"description":"The most to pay per million tokens, in dollars."},"fallbacks":{"type":"array","items":{"type":"string"}},"pay":{"type":"string","enum":["ours","mine"]},"route":{"type":"object"}}},"Response":{"type":"object","required":["id","object","status","output"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"response"},"created_at":{"type":"integer"},"status":{"type":"string","enum":["queued","in_progress","completed","incomplete","failed","cancelled"]},"model":{"type":"string"},"output":{"type":"array","items":{"type":"object"}},"usage":{"$ref":"#/components/schemas/Usage"},"error":{"type":["object","null"]},"openagents":{"$ref":"#/components/schemas/ResponseInfo"}}},"Usage":{"type":["object","null"],"properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"input_tokens_details":{"type":"object"},"output_tokens_details":{"type":"object"}}},"ResponseInfo":{"type":"object","description":"Which model and provider answered, every attempt, and the cost.","properties":{"model":{"type":"string"},"upstream":{"type":"string"},"attempts":{"type":"array","items":{"type":"object"}},"cost":{"$ref":"#/components/schemas/Cost"}}},"Cost":{"type":"object","properties":{"upstream_usd":{"type":"string"},"margin_usd":{"type":"string"},"price_usd":{"type":"string"},"price_sats":{"type":"integer"}}},"ChatCompletionRequest":{"type":"object","description":"An OpenAI Chat Completions request, translated onto the same request model.","required":["model","messages"],"properties":{"model":{"type":"string"},"messages":{"type":"array","items":{"type":"object","required":["role"],"properties":{"role":{"type":"string"},"content":{}}}},"max_tokens":{"type":"integer"},"max_completion_tokens":{"type":"integer"},"temperature":{"type":"number"},"top_p":{"type":"number"},"tools":{"type":"array","items":{"type":"object"}},"tool_choice":{},"response_format":{"type":"object"},"stream":{"type":"boolean"},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}}},"openagents":{"$ref":"#/components/schemas/RequestOptions"}}},"ChatCompletion":{"type":"object","required":["id","object","choices"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"chat.completion"},"created":{"type":"integer"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":["string","null"]},"tool_calls":{"type":"array","items":{"type":"object"}}}},"finish_reason":{"type":["string","null"]}}}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}}},"Compaction":{"type":"object","properties":{"output":{"type":"array","items":{"type":"object"}}}},"Deleted":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}},"ModelList":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"type":"object","required":["id"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"model"},"owned_by":{"type":"string"},"openagents":{"type":"object","description":"Providers, capabilities, context, price rows, live latency, free-tier coverage, and verified paid outcomes by task class.","properties":{"accepted_outcomes":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AcceptedOutcomes"},"description":"Only real paid work; empty when no outcomes exist."}}}}}}}},"AcceptedOutcomes":{"type":"object","properties":{"samples":{"type":"integer","minimum":1},"accepted":{"type":"integer","minimum":0},"accepted_rate":{"type":"number","minimum":0,"maximum":1},"cost_usd":{"type":"string"},"cost_per_accepted_usd":{"type":["string","null"],"description":"All evaluated work's inference cost divided by accepted outcomes, to whole dollar micros; null when none were accepted."},"paid_msat":{"type":"integer","minimum":1}}},"RateCard":{"type":"object","required":["v","unit","rows"],"properties":{"v":{"type":"string"},"unit":{"type":"string","description":"What every amount is: USD per million tokens."},"charged_in":{"type":"string"},"sats_rate":{"type":"object","properties":{"usd_per_btc":{"type":"integer"},"as_of":{"type":"string"}}},"rows":{"type":"array","items":{"$ref":"#/components/schemas/RateRow"}}}},"RateRow":{"type":"object","description":"One model through one provider: the provider's list price, our margin, and the price you pay, per million tokens, in dollars.","required":["model","provider","upstream","kind","margin_percent","input","cached_input","output"],"properties":{"model":{"type":"string"},"provider":{"type":"string"},"upstream":{"type":"string","description":"The id `openagents.route` takes."},"kind":{"type":"string","enum":["list","promotion","scheduled"]},"label":{"type":"string"},"margin_percent":{"type":"string"},"input":{"$ref":"#/components/schemas/Amount"},"cached_input":{"$ref":"#/components/schemas/Amount"},"output":{"$ref":"#/components/schemas/Amount"}}},"Amount":{"type":"object","properties":{"list_usd":{"type":"string"},"margin_usd":{"type":"string"},"price_usd":{"type":"string"},"price_sats":{"type":"integer"}}},"UsageView":{"type":"object","properties":{"request_id":{"type":"string"},"model":{"type":"string"},"upstream":{"type":"string"},"attempts":{"type":"array","items":{"type":"object"}},"charge":{"type":"object"}}},"KeyView":{"type":"object","properties":{"key":{"type":"string"},"balance_usd":{"type":["string","null"]},"spend":{"type":"object"},"limits":{"$ref":"#/components/schemas/Limits"},"free_tier":{"type":["object","null"]}}},"Limits":{"type":"object","description":"Limits only the key's owner sets. Every field is optional; we set none.","properties":{"spend_cap":{"type":["object","null"],"properties":{"usd":{"type":"string"},"period":{"type":"string","enum":["day","month","total"]}}},"max_price":{"type":["object","null"],"properties":{"input":{"type":"string"},"output":{"type":"string"}}},"models":{"type":["array","null"],"items":{"type":"string"}},"requests_per_minute":{"type":["integer","null"]},"expires_at":{"type":["integer","null"],"description":"Unix seconds."}}},"KeyList":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object"}}}},"ProviderKeyList":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/ProviderKey"}}}},"ProviderKey":{"type":"object","properties":{"provider":{"type":"string"},"fingerprint":{"type":"string"},"added_at":{"type":"integer"}}},"IssuedKey":{"type":"object","properties":{"key":{"type":"object"},"secret":{"type":"string","description":"`oak_...`, shown once."}}}}},"x-service-info":{"name":"OpenAgents API","categories":["ai","inference"],"docs":{"homepage":"https://openagents.com/docs/api","apiReference":"http://api.openagents.com/v1/openapi.json","llms":"https://openagents.com/llms.txt","payments":"https://openagents.com/docs/api/for-agents"}},"x-openagents-payment-methods":[]}