Agents
Hosted AI agents. Any model, your tools, one key.
An agent is a model with a system prompt, webhook skills you host, memory per session and a schedule. Create it with one API call, message it with another, or build it in the console.
One turnClaude Sonnet 5.5
- POST /messagessession customer-1842
- memoryhistory loaded for customer-1842
- model call 1Claude Sonnet 5.5 · 1,240 in → 46 out · $0.001626
- skill lookup_ordersigned POST → 200
- model call 21,410 in → 180 out · $0.002232
- memory2 messages appended
- turn donetokens $0.003858 + fee $0.005
- turn.done → webhooksigned
What an agent is
- One model
- Any chat model in the catalog, named by id. Change it with a PATCH; the memory and skills stay.
- Your webhook skills
- A name, a JSON schema and a URL you host. Tool calls arrive signed; your JSON answer goes back to the model.
- Memory
- Conversation history per session id, kept on the instance. Send the same session id to continue.
- Cron
- A prompt on a schedule, run as a turn. Skipped when the balance is empty.
- API and webhooks
- Send messages and read turns over REST. Turn events post to your webhook, signed, with retries.
- Billing you can read
- Every turn carries its charge, and each model call inside it is on the receipt.
Pricing
Fees come from GET /v1/agents/pricing. Tokens bill at the price on each model page, the same as a direct request. Both draw from the prepaid balance.
| Tier | Instance | Skills | Crons | Per turn |
|---|---|---|---|---|
| Starter | $9 a month | up to 3 | up to 1 | tokens at the model price + $0.005 |
| Pro | $39 a month | up to 20 | up to 20 | tokens at the model price + $0.005 |
Create one, then message it
bash
1
curl https://api.relayswitch.io/v1/agents \2
-H "Authorization: Bearer $RELAYSWITCH_KEY" \3
-H "Content-Type: application/json" \4
-d '{5
"name": "support",6
"model": "claude-sonnet-5-5",7
"tier": "starter",8
"system_prompt": "You answer billing questions for our store.",9
"skills": [{10
"name": "lookup_order",11
"description": "Find an order by its number",12
"url": "https://example.com/hooks/lookup-order",13
"parameters": { "type": "object", "properties": { "order": { "type": "string" } } }14
}],15
"webhook_url": "https://example.com/hooks/agent-events"16
}'bash
1
curl https://api.relayswitch.io/v1/agents/AGENT_ID/messages \2
-H "Authorization: Bearer $RELAYSWITCH_KEY" \3
-H "Content-Type: application/json" \4
-d '{ "session_id": "customer-1842", "content": "Where is order 10422?" }'- The create call answers 201 with the agent and a
webhook_secret, shown once; use it to check the signature on events and tool calls. - The message call answers with the turn:
output,charge_usd,fee_usd, and the tool and model calls it took. PATCH /v1/agents/:idwith{ "status": "stopped" }pauses it;POST /v1/agents/:id/cronswith an expression and a prompt schedules it.- The console's Agents page does the same with a form, and shows every turn with its charge.
FAQs
Questions
Skills, memory, billing.
Create an agent on any model
A flat monthly fee for the instance, tokens at the model price, all from one prepaid balance.