API reference

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

Path and query parameters
FieldTypeWhat it is
slug (path)requiredstringThe published agent's slug.

Request body

application/json, required

Request body fields
FieldTypeWhat it is
inputrequiredarray of objectThe conversation so far; the last message must be the visitor's.
input[].rolerequiredanyOne of "user", "assistant".
input[].contentrequiredstring

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.

Antimatter