Completions

Create Completion

Changed on

Generate a text completion. Set stream: true for SSE streaming.

All SSE frames use event: stream_event with a JSON-serialized lithos StreamEvent payload, discriminated by type: started, content_block_start, text_delta, reasoning_delta, tool_call_delta, content_block_end, usage, rate_limits, ended, and error.

post/api/v1/completions

Request

  • The document declares no server URL.
  • Auth
    • HTTP bearer
    • or API key in cookie __fabro_session

Request body

modelstring

Model selector: provider/model, or a model id or alias. A bare provider name is rejected; pin it with provider instead. When omitted, the server picks the pinned provider's default model, or a ready-provider default when provider is also omitted.

providerstring

Optional provider pin. Scopes a bare model selector to that provider, which also lets an uncatalogued model id reach a provider that allows passthrough.

systemstring

System prompt (convenience; prepended as a system message).

streamboolean

Stream response via SSE.

schemaunknown
max_output_tokensinteger
temperaturenumber double
top_pnumber double
stop_sequencesstring[]

Stop sequences.

reasoning_effort'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'

Native reasoning-effort level requested for an LLM call.

speed'fast' | 'balanced' | 'economical'

lithos Speed: the requested latency or cost tier.

metadataobject

Request tags forwarded to providers that accept them.

provider_optionsobject

Raw provider options keyed by provider id.

Response

Completion result (JSON when stream=false, SSE when stream=true)

outputunknown
idstring nullable
suppressed_tool_callsobject[]

Tool calls withheld because the turn ended early.

finish_reasonstring required

Why generation stopped: stop, length, tool_call, content_filter, error, incomplete, or a provider-specific reason.

rate_limitsobject
rawunknown

Example response

{
  "model": {
    "provider": "anthropic"
  }
}

Changes

    • info

      added the optional property // to the response with the status

    • breaking

      the / response's property format changed from int64 to uint64 for status

    • breaking

      the / response's property format changed from int64 to uint64 for status

    • breaking

      the / response's property format changed from int64 to uint64 for status

    • breaking

      the / response's property format changed from int64 to uint64 for status

    • breaking

      the / response's property format changed from int64 to uint64 for status

    • breaking

      the / response's property format changed from int64 to uint64 for status