Skip to main content
POST
/
v1
/
agent
curl --request POST \
  --url https://api.stewrd.dev/v1/agent \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "message": "What is the capital of France?"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "object": "agent.response",
  "status": "completed",
  "message": "<string>",
  "tool_calls": [
    {
      "id": "<string>",
      "name": "<string>",
      "arguments": {}
    }
  ],
  "capabilities_used": [
    "<string>"
  ],
  "files": [
    {
      "name": "<string>",
      "content": "<string>",
      "url": "<string>"
    }
  ],
  "usage": {
    "credits_this_request": 123,
    "credits_remaining": 123,
    "tokens_used": 123
  },
  "meta": {
    "duration_ms": 123,
    "project_id": "<string>",
    "plan": "<string>"
  },
  "_compute_instance": "<string>"
}

Authorizations

Authorization
string
header
required

API key in the format sk-stw_.... Get yours at stewrd.dev/dashboard.

Body

application/json
message
string
required

The task or question for the agent.

Example:

"What is the capital of France?"

capabilities
enum<string>[]

Filter which capabilities to use for this request. Omit to use all capabilities enabled on the project.

Available options:
chat,
research,
documents,
code,
data,
files
files
object[]

Files to include with the request.

stream
boolean
default:false

Set to true to receive a Server-Sent Events stream instead of a JSON response. Not supported when tools is provided.

tools
object[]

Custom tool definitions for function calling. When provided, only the chat capability is used and streaming is disabled. Max 20 tools per request.

Maximum array length: 20

Response

Successful agent response

id
string<uuid>

Unique request identifier.

object
enum<string>

Object type, always agent.response.

Available options:
agent.response
status
enum<string>

Response status. completed when the agent has finished, requires_tool_outputs when the agent needs custom tool results.

Available options:
completed,
requires_tool_outputs
message
string

The agent's response message. Present when status is completed.

tool_calls
object[]

Tool calls the agent wants to make. Present when status is requires_tool_outputs.

capabilities_used
string[]

Capabilities that were used for this request.

files
object[]

Files generated by the agent.

usage
object
meta
object
_compute_instance
string

Compute instance ID — pass back with tool output submissions for machine affinity routing.