AI agent API snippet generator — curl, JavaScript and Python
Build ready-to-paste code for an OpenAI-compatible agent chat endpoint, with per-end-user isolation and streaming. Works with FastClaw's /v1/chat/completions.
Sent as the user field — that user's history and personal memory stay private to them.
Sent as X-Fastclaw-Session-Key — keep it stable per conversation, e.g. myapp:conv_42.
The key stays a placeholder: read it from FASTCLAW_API_KEY on your server, never ship it to the browser.
curl -sN "http://localhost:18953/v1/chat/completions" \
-H "Authorization: Bearer $FASTCLAW_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Fastclaw-Session-Key: myapp:conv_42" \
-d '{
"user": "user-123",
"stream": true,
"messages": [
{
"role": "user",
"content": "Summarize today'\''s support tickets"
}
]
}'Need a key?
Create a user-scope key in the console or with fastclaw apikey create --type user.
Related
Runtime API
Drive FastClaw agents from any app: OpenAI-compatible chat completions, agent management, per-end-user isolation, usage reporting and ACP.
SaaS builders
Give every customer their own AI agent without building a runtime. FastClaw handles agents, end-user isolation, sandboxed tools and usage metering over an API.
PostgreSQL
Swap FastClaw's default SQLite file for PostgreSQL to run multiple pods behind a load balancer, with automatic schema migrations.
Try it on your own agents
Start free in FastClaw Cloud, or self-host the single binary in a minute.