OpenAI Compatibility
Point your existing OpenAI client at SingularityAPI
The contract
/v1/chat/completions and /v1/responses speak the same request and response wire format as the OpenAI API. If your code already uses the official openai SDK, it keeps working — change the base_url and the API key, nothing else.
What differs from OpenAI
- Unsupported parameters fail loudly. Unknown or reserved fields are rejected with a 400
invalid_requesterror, never silently dropped. What you send is exactly what runs. - The output-limit field is per-model. DeepSeek and Kimi models accept
max_tokens. gpt-5.6 models acceptmax_completion_tokenson chat completions andmax_output_tokenson responses. Sending the wrong field for the model is a 400. Omit the field and the per-model default applies — see the table on Models & Pricing. modelmust be a catalog slug orcontract/{slug}. See Contracts for how contract slugs resolve to a served model.- Duplicate JSON keys and
NaN/Infinityliterals are rejected with a 400. - Context overflow is rejected before any tokens are spent. If your estimated input plus the requested output limit exceeds the model’s context window, the request fails with a 400.
- Three extra response headers appear on every response:
x-singularity-request-id,x-singularity-receipt-id, and — on contract calls —x-singularity-contract-revision.
Everything else in the OpenAI request schema passes through unmodified to the model.