API reference

Keiro exposes three authenticated completion surfaces at one public base URL:

On this page 1 of 6
Text
https://api.keirolabs.ai/v1

Choose the wire format that already fits your application. The model and account determine which capabilities are available; the endpoint does not expose private routing or provider details.

Completion endpoints#

SurfaceEndpointPrimary inputGenerated text
ResponsesPOST /responsesinput or typed input itemsSDK output_text, or text parts in output
Chat CompletionsPOST /chat/completionsmessageschoices[0].message.content
MessagesPOST /messagesmessages, with optional top-level systemText blocks in content

All three surfaces support buffered responses and server-sent event streams. Function tools and image input use the native content shape for each surface.

Discovery endpoint#

Use GET /v1/models with the same bearer authentication to list the public model IDs available to the current key. The result is account-scoped and can include effective static limits for each model.

See Models for a runnable request and model-selection guidance.

Utility endpoints#

Use POST /messages/count_tokens to estimate the prompt size of a Messages request before sending it. The estimate uses the same per-part minimums that admission and billing apply, so multimodal estimates match what a real request is charged. See Messages.

Other operational routes reachable on the base URL — tool-output submission, stream resume, request cancel, and capability discovery — are not yet part of the documented public contract. Do not build against them until they appear in this reference.

Shared request contracts#

  • Authenticate with Authorization: Bearer <api-key>; see API auth.
  • Use only a model returned for the current key; see Models.
  • Add Idempotency-Key when retrying a logical operation must not execute it twice; see Idempotency.
  • Read request IDs and rate-limit headers for operational handling; see Rate and spend limits.
  • Match failures on the machine-readable error code and type, not message text; see Errors.
  • Streams carry documented per-effort time entitlements: a stream that is actively working is never ended before its effort tier's wall-clock ceiling; see Streaming.

Compatibility boundary#

Keiro is OpenAI-compatible where documented, but compatibility does not mean that every parameter from every SDK or vendor API is accepted. Unknown or unsupported fields fail closed under the current strict validation contract. Build against the fields documented for the selected surface and treat a capability error as a request or model-selection issue, not as permission to fall back silently.

Search Keiro docs

Start typing to search pages and sections.

Start typing to search pages and sections.

Documentation

Console