API reference · Agents
Run a published agent on your own balance
POST/api/agents/public/{slug}/runsSigned in session
Billed to the signed in visitor through the usual holds; the owner pays nothing. Same origin only. A 404 while hosted runs or public agents (ANTIMATTER_AGENT_PUBLISH) are off on the deployment.
Parameters
| Field | Type | What it is |
|---|---|---|
| slug (path)required | string | The published agent's slug. |
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| inputrequired | array of object | The conversation so far; the last message must be the visitor's. |
| input[] | any | One of "user", "assistant". |
| input[] | string |
Example
{
"input": [
{
"role": "user",
"content": "Say hello in five words."
}
]
}Answer 201
The run.
The answer's fields are not named in the document.
Errors
- 400OpenAI shaped error.
- 401OpenAI shaped error.
- 402OpenAI shaped error.
- 404OpenAI shaped error.
- 429OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.