Create a chat completion
POST/v1/chat/completionsGenerate a completion from a published model. Request and response are wire-compatible with OpenAI's /v1/chat/completions, so any OpenAI SDK works by pointing base_url at https://adversariallm.ai/v1 and passing your API key.
Streaming. Set stream: true to receive text/event-stream frames of chat.completion.chunk objects terminated by data: [DONE]. Only completion frames are emitted — internal status events (queued, waking) are never mixed into the stream. With stream_options.include_usage the final frame carries usage and an empty choices array.
Unsupported OpenAI fields are ignored, not rejected, so a client written against OpenAI does not break on an option this platform does not implement. max_completion_tokens takes precedence over max_tokens; both default to 1024. reasoning_effort accepts low/medium/high.
Billing. Cost is reserved on admission and settled on the measured token counts; a failed or cancelled generation releases its reservation. Free accounts draw on a monthly message allowance that renews on the 1st.
Requires a bearer API key on every call.
Authorization: Bearer ad_live_…
An API key, sent as Authorization: Bearer <key>.
Keys look like ad_live_… (production traffic, real spend) or ad_test_…. Create them in the dashboard under API keys. The full value is shown exactly once, at creation — only a SHA-256 hash is stored, so a lost key cannot be recovered, only rotated. Revoking a key takes effect immediately on the next request.
modelrequiredmessagesrequiredCompatMessage[] attributes
rolerequiredcontentoptionalstreamoptionalstream_optionsoptionalStreamOptions | null attributes
include_usageoptionalmax_tokensoptionalmax_completion_tokensoptionaltemperatureoptionaltop_poptionalstopoptionalseedoptionalreasoning_effortoptionaluseroptionalA chat.completion object — or, when stream: true, an SSE stream of chat.completion.chunk frames ending in data: [DONE].
idrequiredGeneration id; also usable in support.
objectrequiredcreatedrequiredUnix seconds.
modelrequiredchoicesrequiredobject[] attributes
indexoptionalmessageoptionalobject attributes
roleoptionalcontentoptionalfinish_reasonoptionalusageoptionalUsage attributes
prompt_tokensoptionalcompletion_tokensoptionaltotal_tokensoptionalprompt_tokens_detailsoptionalobject attributes
cached_tokensoptionalcode, never on the messageunauthorizedMissing, malformed, or revoked API key.
email_unverifiedThe owning account has not confirmed its email address. Open the sign-in link that was mailed to it; the same key then works unchanged.
account_suspendedThe account is suspended and cannot start new generations.
model_not_foundNo published model has that id. Call GET /v1/models for the live list.
model_unavailableThe model exists but has no servable version right now.
model_cold_startThe model is asleep, and free accounts run only on models that are already awake. details.warm_models lists what is awake; details.estimated_wait_s is how long it takes to wake.
validation_errorThe request body or query is malformed, or names an unsupported option.
free_allowance_exhaustedThe free tier's MONTHLY message allowance is spent — it renews on the 1st. details carries limit, used and the upgrade path. 429, never 402.
quota_exceededA plan limit was hit. details.reason is concurrency (too many generations in flight — retry when one finishes) or daily_output_tokens.
insufficient_creditsThe balance will not cover the estimated cost of this request. Surfaced on /v1 as OpenAI's insufficient_quota. 429, never 402.
service_disabledAn operator has paused new generations platform-wide.
Status codes returned by this endpoint: 401, 403, 404, 409, 422, 429, 503. Every code and what to do about it is on Errors.
https://adversariallm.ai/v1/chat/completions