Run a tool
Start a tool run. It answers 202 with the run, which you poll at /v1/tools/runs/{id}. The input is checked against the tool before anything is reserved.
bearerAuthAuthorizationBearer <token>Your API key, sent as Authorization: Bearer <key>.
Idempotency-Key?stringAny string you choose. A retry with the same key and body returns the first result instead of running again. The same key with a different body is a 409 idempotency_conflict.
application/json- body
tool*stringThe tool id, such as exa/search.
input*The tool's input, as its page lists it.
The run, accepted.
application/json- response
id*stringobject*stringtool*stringstatus*string"queued""processing""succeeded""failed""canceled"outcome?"no_match"Set on a succeeded run that found nothing. Billed like any other answer.
"no_match"output?array<>The result, as signed links like a job's output.
error?usage?created_at*stringdate-timecompleted_at?stringdate-timecurl -X POST "https://example.com/v1/tools/runs" \ -H "Authorization: Bearer $OP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "tool": "string", "input": {} }'{ "id": "string", "object": "tool.run", "tool": "string", "status": "queued", "outcome": "no_match", "output": [ { "url": "string", "url_expires_at": "2019-08-24T14:15:22Z", "type": "string", "bytes": 0 } ], "error": { "code": "string", "kind": "string", "scope": "string", "message": "string" }, "usage": { "units": { "property1": 0, "property2": 0 }, "cost": { "billing_usd": 0, "cost_source": "string", "cost_status": "string", "price_version": "string" } }, "created_at": "2019-08-24T14:15:22Z", "completed_at": "2019-08-24T14:15:22Z"}Run a task POST
Run a task on an input and get JSON checked against its output schema. `{name}` is the task's name for its latest version, or `name@n` for version `n`. An answer that fails the schema is repaired once, as a second billed generation; a refusal or a cut-off answer is not.
OpenAI SDK
Use the official OpenAI SDK for Python or TypeScript.