AVIS Documentation
Start building with open models.
Get started in minutes
Make your first API call in under 5 minutes.
This quickstart walks through the basic setup: create an account, generate an API key, and create your very first request. The examples use the same request in several languages, so you can start with the one that matches your stack.
With your first request done, use the guides for deeper setup and the API reference for endpoints and parameters.
Make your first request
Pick an API reference in our documentation, replace YOUR_API_KEY, and run.
Creating an API key
Sign in at avis.net
Go to Settings → API Keys.
Click Create key, give it a name, and save it somewhere safe — the raw key is only shown once at creation time (it can be revealed again later from the same page).
A single account may have a limit on the number of API keys. Creating past the limit returns 403 Forbidden.## Enabling / disabling streaming
| Surface | How to stream | How to get a single JSON response |
|---|---|---|
| OpenAI (`chat/completions`, `/responses`) | `"stream": true` in the request body | `"stream": false` (default) |
| OpenAI (`images/generations`) | `"stream": true` — only honored when the resolved model's provider supports streamed image events; otherwise the request still completes, just as a single JSON response | `"stream": false` (default) |
| OpenAI (`videos`) | Not applicable — video generation is always async (submit + poll), see [OpenAI compatibility](./openai-compatibility.md) | n/a |
| Anthropic (`messages`) | `"stream": true` in the request body | `"stream": false` (default) |
| Gemini | Call `models/{model}:streamGenerateContent` instead of `models/{model}:generateContent` | Call `:generateContent` |
All streamed responses are sent as `Content-Type: text/event-stream` with `Cache-Control: no-cache, no-transform` and `Connection: keep-alive`.## Endpoints
| Method | Path | Description |
| --- | --- | --- |
| GET | `/api/compat/v1/usage` | List generation records from `generations` table |
Auth: `Authorization: Bearer <jwt>` or `x-api-key`.
## GET /api/compat/v1/usage
Query fields:
| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `offset` | `number` | No | Default `0` |
| `limit` | `number` | No | Default `20` |
Response shape:
| Field | Type |
| --- | --- |
| `results[]` | Array of generation rows |
| `results[].id` | `string` |
| `results[].userId` | `string` |
| `results[].apiKeyId` | `string \| undefined` |
| `results[].modality` | `"text" \| "image" \| "video" \| "audio"` |
| `results[].model` | `string` |
| `results[].status` | `"succeeded" \| "failed" \| "aborted" \| "cancelled"` |
| `results[].request` | `object \| undefined` |
| `results[].usage` | `object \| undefined` |
| `results[].usdCost` | `number \| undefined` |
| `results[].durationMs` | `number \| undefined` |
| `results[].createdAt` | `datetime` |
| `total` | `number` |
| `offset` | `number` |
| `limit` | `number` |
This endpoint currently supports paging only and returns compat generation rows.
## Note About `generations` Data
This endpoint returns a **compact usage record**, including `request` payload and `usdCost`.
## Reference: `usage` By Modality (From `generations`)
Based on current real records, the `usage` payload is modality-specific.
### Text
Typical fields:
| Field | Type |
| --- | --- |
| `usage.promptTokens` | `number` |
| `usage.completionTokens` | `number` |
| `usage.totalTokens` | `number` |
### Image
Typical fields:
| Field | Type |
| --- | --- |
| `usage.generatedImages` | `number` |
| `usage.inputTokens` | `number` |
| `usage.outputTokens` | `number` |
| `usage.totalTokens` | `number` |
### Video
Typical fields:
| Field | Type |
| --- | --- |
| `usage.completionTokens` | `number` |
| `usage.totalTokens` | `number` |
The exact `usage` keys can vary by provider/model.
Base URL
Switching an existing app
Nothing else in your existing Anthropic integration needs to change.
Endpoints
HEAD
/api/anthropic
—
Connectivity probe (no auth)
GET
/api/anthropic/v1/models
—
List available models
POST
/api/anthropic/v1/messages
✅
Messages API
anthropic-version and anthropic-beta request headers are forwarded to the upstream provider when present — see Authentication.
POST /messages
Base URL
The
@google/genaiSDK appends/v1betatobaseUrlautomatically. Passhttps://api.avis.net/api/gemini— not.../api/gemini/v1beta— or you'll get a doubled path.
Switching an existing app
Model IDs use the google/ prefix, e.g. google/gemini-2.0-flash.
Endpoints
HEAD
/api/gemini
—
Connectivity probe (no auth)
GET
/api/gemini/v1beta/models
—
List available models
POST
/api/gemini/v1beta/models/{model}:generateContent
—
Generate content
POST
/api/gemini/v1beta/models/{model}:streamGenerateContent
✅
Generate content, streamed
POST /models/{model}:generateContent
POST /models/{model}:streamGenerateContent
Last updated
Was this helpful?


