Speko Docs
API Reference

Complete

Single-turn LLM call routed to the best provider for your intent, with automatic failover. Returns assistant text + token usage.

POST
/v1/complete

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

text/event-stream

application/json

application/json

application/json

"string"
{
  "error": "Invalid request",
  "code": "VALIDATION_ERROR",
  "issues": [
    {
      "path": "to",
      "message": "Required"
    }
  ],
  "retryable": false,
  "docs_url": "https://docs.speko.dev/errors/validation_error"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
{
  "error": "All providers failed",
  "code": "COMPLETE_FAILED"
}