Use the AI Gateway
The AI Gateway serves language, image, video, audio and speech models of many providers through one API and one
key. A request names a model; the gateway chooses a route of a provider that serves it, and the call is paid from
the team's plan or credits at the price GET /v1/models lists.
- The base address is
https://gizstack.com/v1. Send the key asAuthorization: Bearer KEY. Make a key on the terminal token page. - The API follows the OpenAI API, so an OpenAI client works with the base address and the key changed.
- The machine-readable form of this page is /v1/openapi.json. The same operations are MCP tools
at
/v1/mcp.
curl https://gizstack.com/v1/chat/completions \
-H "Authorization: Bearer $GIZSTACK_KEY" -H "Content-Type: application/json" \
-d '{"model": "MODEL", "messages": [{"role": "user", "content": "Hello"}]}'Operations
The table and the sections below are made from the table that serves the API.
| Operation | Request | What it does |
|---|---|---|
models | GET /v1/models | The models of the catalog, with their kinds and prices. |
chat | POST /v1/chat/completions | Ask a language model: a chat completion request (model, messages and its other fields); the answer is the completion object. |
responses | POST /v1/responses | Ask a language model, or an Agent of the team as agent:ID, in the form of the Responses API. |
response | GET /v1/responses/{id} | An Agent's turn that a response started. |
messages | POST /v1/messages | Ask a language model in the form of the Messages API. |
generate | POST /v1/generations | Start a media generation (image, video, audio, speech or 3D): the model and its fields; wait (s) waits for it. |
task | GET /v1/tasks/{id} | A generation's task: its state and outputs. |
images | POST /v1/images/generations | Make pictures of a prompt, in the form of the Images API. |
speech | POST /v1/audio/speech | Speak a text, in the form of the Audio API. |
transcriptions | POST /v1/audio/transcriptions | Write what a recording says (a multipart form with its file). |
embeddings | POST /v1/embeddings | Turn texts into vectors, in the form of the Embeddings API. |
rerank | POST /v1/rerank | Order documents by how well each answers a query. |
upload | POST /v1/files | Keep an input file (a picture, a video or a sound) in the team's Drive: ?name=cat.png, the file as the body. The answer's address is what a generation's file field takes; it ends in an hour. |
usage | GET /v1/usage | What the key stands at: plan, windows, what its team can spend and its rules. |
GET /v1/models
The models of the catalog, with their kinds and prices. It is also the MCP tool models.
POST /v1/chat/completions
Ask a language model: a chat completion request (model, messages and its other fields); the answer is the completion object. With "stream": true the answer comes as server-sent events. It is also the MCP tool chat.
| Field | Type | Required | Meaning |
|---|---|---|---|
model | string | yes | The model id, from models. |
messages | array | yes | The chat messages: role and content. |
POST /v1/responses
Ask a language model, or an Agent of the team as agent:ID, in the form of the Responses API. With "stream": true the answer comes as server-sent events.
| Field | Type | Required | Meaning |
|---|---|---|---|
model | string | yes | The model id, from models. |
input | string | yes | The text, or the list of input items. |
GET /v1/responses/{id}
An Agent's turn that a response started.
| Field | Type | Required | Meaning |
|---|---|---|---|
id | string | yes | The response id. |
POST /v1/messages
Ask a language model in the form of the Messages API. With "stream": true the answer comes as server-sent events.
| Field | Type | Required | Meaning |
|---|---|---|---|
model | string | yes | The model id, from models. |
messages | array | yes | The messages: role and content. |
max_tokens | integer | yes | The most tokens of the answer. |
POST /v1/generations
Start a media generation (image, video, audio, speech or 3D): the model and its fields; wait (s) waits for it. It is also the MCP tool generate.
| Field | Type | Required | Meaning |
|---|---|---|---|
model | string | yes | The media model id, from models. |
wait | integer | no | Seconds to wait for the result. |
GET /v1/tasks/{id}
A generation's task: its state and outputs. It is also the MCP tool task.
| Field | Type | Required | Meaning |
|---|---|---|---|
id | string | yes | The task id. |
POST /v1/images/generations
Make pictures of a prompt, in the form of the Images API.
| Field | Type | Required | Meaning |
|---|---|---|---|
model | string | yes | The image model id, from models. |
prompt | string | yes | What the picture shows. |
POST /v1/audio/speech
Speak a text, in the form of the Audio API.
| Field | Type | Required | Meaning |
|---|---|---|---|
model | string | yes | The speech model id, from models. |
input | string | yes | The text to speak. |
POST /v1/audio/transcriptions
Write what a recording says (a multipart form with its file).
| Field | Type | Required | Meaning |
|---|---|---|---|
model | string | yes | The transcription model id, from models. |
POST /v1/embeddings
Turn texts into vectors, in the form of the Embeddings API. It is also the MCP tool embeddings.
| Field | Type | Required | Meaning |
|---|---|---|---|
model | string | yes | The embedding model id, from models. |
input | string | yes | A text, or an array of texts. |
POST /v1/rerank
Order documents by how well each answers a query. It is also the MCP tool rerank.
| Field | Type | Required | Meaning |
|---|---|---|---|
model | string | yes | The rerank model id, from models. |
query | string | yes | The question. |
documents | array | yes | The texts to order. |
top_n | integer | no | How many to return. |
POST /v1/files
Keep an input file (a picture, a video or a sound) in the team's Drive: ?name=cat.png, the file as the body. The answer's address is what a generation's file field takes; it ends in an hour.
| Field | Type | Required | Meaning |
|---|---|---|---|
name | string | yes | The file's name, with its extension (in the query). |
GET /v1/usage
What the key stands at: plan, windows, what its team can spend and its rules. It is also the MCP tool usage.