v0.1.0

API reference

The AdversariaLLM inference and catalog API.

The whole integration

The inference surface is wire-compatible with OpenAI’s. If you already call an OpenAI SDK, the migration is two lines — and nothing else in your code changes.

diff
- base_url="https://api.openai.com/v1"
+ base_url="https://adversariallm.ai/v1"
- api_key=os.environ["OPENAI_API_KEY"]
+ api_key=os.environ["AD_API_KEY"]

Fields this platform does not implement are ignored rather than rejected, so an SDK upgrade on your side does not break calls on ours.

Start here
Chat2 endpoint(s)

The OpenAI-compatible surface. Point any OpenAI SDK at https://adversariallm.ai/v1 with a AdversariaLLM API key and it works unchanged.

Catalog2 endpoint(s)

The public model catalog and its evaluation results. No credential required.

Plans1 endpoint(s)

The public price list. Purchasing happens in the dashboard, not the API.

Status1 endpoint(s)

Liveness, for uptime monitors.

Machine-readable

This page is generated from the same OpenAPI document your client can read: GET /api/public-openapi.json. It is served unauthenticated with an ETag and permissive CORS, and it contains the public surface only — the private surface is filtered out at the source, not hidden here.

About this document

The AdversariaLLM REST API.

Base URL

https://adversariallm.ai

Authentication

Every authenticated endpoint takes an API key as a bearer token:

Authorization: Bearer ad_live_xxxxxxxxxxxxxxxxxxxxxxxx

Keys are created in the dashboard. ad_live_… keys spend real credit; ad_test_… keys are for integration work. A key's full value is shown once, at creation — only its SHA-256 hash is stored, so a lost key is rotated, never recovered. Revocation is immediate.

Never put a key in browser JavaScript or a mobile binary: it carries the full spending authority of the account that owns it.

OpenAI compatibility

/v1/chat/completions and /v1/models match OpenAI's request and response shapes, including the error object. An existing integration usually needs two lines changed — base_url and api_key. Fields this platform does not implement are ignored rather than rejected, so an SDK upgrade on your side does not break calls on ours.

Errors

Native endpoints return {"error": {"code", "message", "details"?}}; /v1 endpoints return OpenAI's error object. In both, code is the contract — switch on it, never on the message text.

Quota and balance failures are 429 with a machine-readable code, never 402. A 402 tells every HTTP client "payment required", and being out of quota is not a payment challenge — this API returns 402 nowhere. The full code table is published as the x-error-codes extension on this document.

Money

All amounts are integer micro-USD: 1 USD = 1,000,000. There are no floating point amounts anywhere in this API.

Streaming

Streaming responses are text/event-stream. Frames are JSON objects on data: lines, terminated by data: [DONE]. Status events are never interleaved into a completion stream.

API reference · AdversariaLLM