Vibe Coding
Back to FastClaw

FastClaw / APIs and integrations

Upstream API

FastClaw provides /v1/* API for upstream applications. The core is OpenAI-compatible chat completions, plus agents, users, usage, and quota.

Upstream API key concepts infographic
Upstream API key concepts infographic

API boundaries

docs/upstream-api.md clearly states that /v1/* is a stable interface for upstream applications; /api/* and CLI are more focused on operator/admin workflow.

interfacePurpose
POST /v1/chat/completionsOpenAI-compatible dialogue, supports stream and non-stream
GET /v1/agentsList Agents accessible by the current key
POST /v1/usersExplicitly create or bind app_user
GET /v1/usageQuery usage
/v1/quotaQuery or consume quota-related capabilities

Certification

The upstream API uses Authorization: Bearer fcak_…. API key types include admin, user, and agent. The documentation emphasizes not exposing keys to browsers or mobile devices.

curl http://localhost:18953/v1/chat/completions \
  -H "Authorization: Bearer fcak_xxx" \
  -H "Content-Type: application/json" \
  -d '{"agent_id":"agt_xxx","messages":[{"role":"user","content":"Hello"}]}'

Chat extension fields

In addition to OpenAI messages/model/stream, FastClaw also supports agent_id, user, params, images, imageUrls, attachments, and headers such as X-Fastclaw-Session-Key and X-Fastclaw-End-User.

  • agent_id: Select the Agent that handles the request.
  • user or X-Fastclaw-End-User: Maps the end user in the upstream product.
  • attachments: The server will materialize to /workspace and inject the path into the message.
  • X-Fastclaw-Session-Key: Allows upstream applications to stably reuse the same session.