API reference
API reference
Every Foundation Machines API endpoint and error type.
Endpoints
GET /health
Public. Returns {"ok":true,"service":"foundation-gateway"}.
GET /v1/models
Returns OpenAI-format { object: "list", data: [...] } of all available models.
POST /v1/chat/completions
OpenAI-compatible chat. Streaming supported via stream: true.
POST /v1/completions
OpenAI-compatible legacy completions.
POST /v1/responses
OpenAI Responses API. Forthcoming: returns 501 not_implemented today; use /v1/chat/completions with the same model ids in the meantime.
POST /v1/audit
Sebastion AI security audit. Live. Synchronous snippet audits, see the audit reference for the full request and response schema. The same engine powers the Sebastion AI GitHub App.
GET /v1/usage/me
Self-service usage. Returns your tenant, plan, daily token total, limits.
Errors
{ "error": { "type": "rate_limit", "message": "20 rpm exceeded for plan pro" } }| HTTP | type | meaning |
|---|---|---|
| 401 | unauthorized | bad or missing bearer |
| 403 | model_forbidden | model not allowed on your plan |
| 429 | rate_limit | per-minute cap hit; back off |
| 429 | quota_exceeded | daily token cap hit; resets at UTC midnight |
| 501 | not_implemented | endpoint exists but not yet generally available |