API reference

API reference · Agents

What a run of a published agent would hold first

POST/api/agents/public/{slug}/quoteSigned in session

The first step's worst case and the run's ceiling, in micro-USD, for the signed in visitor. 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 200

The quote.

Fields of the 200 answer
FieldTypeWhat it is
objectstring
first_step_microsinteger
max_cost_microsinteger

Errors

  • 400OpenAI shaped error.
  • 401OpenAI 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