Inference endpoint API
Every virtual machine prepared for AI Studio has one inference endpoint. Each deployment on the virtual machine answers on that endpoint under its own model name. The API follows the OpenAI shape, so most OpenAI client libraries work by changing the base URL and the key.
The endpoint address
Section titled “The endpoint address”The Inference page in the portal shows the endpoint address for the selected virtual machine, together with a quick-start example in curl and Python. The address is specific to the virtual machine; the paths below are relative to it.
The endpoint is served over HTTPS with a certificate issued by Chapek. The Inference page offers the CA certificate for download so your client can verify the connection.
Authentication
Section titled “Authentication”Requests carry an API key as a bearer token:
Authorization: Bearer <your-key>Keys are created under AI Studio → API keys and belong to one virtual machine. When you create a key, you set:
| Setting | Meaning |
|---|---|
| Model aliases | Which deployed model names the key may call. Leave empty to allow every model deployed on the virtual machine. |
| Rate limit | Requests per minute. |
| Concurrent requests | How many requests may be in flight at once. |
| Expiry | 30 days by default, up to one year. |
The key is shown once, when it is created. Store it in your secrets manager; it cannot be retrieved later. A new key shows as pending until the virtual machine has acknowledged it, then active. Use it only once it is active.
Your key never leaves your virtual machine’s inference gateway when a request is validated: there is no round trip to the portal per request, so inference keeps working during a portal outage.
Rotate a key
Section titled “Rotate a key”- Create a new key and wait until it is active.
- Switch your application to it.
- Revoke the old key. Requests with a revoked key receive
401.
You can change a key’s rate limit after creation. A revoked key cannot be reactivated.
Endpoints
Section titled “Endpoints”| Path | Use |
|---|---|
POST /v1/chat/completions |
Chat-style requests with a list of messages. |
POST /v1/completions |
Plain text completion. |
POST /v1/embeddings |
Embedding vectors, for models that support it. |
Set model to the inference model name of a ready deployment. For a
catalogue model that is the name you gave it when you deployed it, or the
model’s own name if you left that empty. A fine-tuned model always uses its
fixed ft- name.
Streaming is supported: set "stream": true and read the server-sent
events as you would with OpenAI.
Examples
Section titled “Examples”With curl:
curl https://<endpoint>/v1/chat/completions \ -H "Authorization: Bearer <your-key>" \ -H "Content-Type: application/json" \ -d '{ "model": "<inference model name>", "messages": [{"role": "user", "content": "Hello"}], "stream": false }'With the OpenAI Python client:
from openai import OpenAI
client = OpenAI( base_url="https://<endpoint>/v1", api_key="<your-key>",)
response = client.chat.completions.create( model="<inference model name>", messages=[{"role": "user", "content": "Hello"}],)print(response.choices[0].message.content)Errors
Section titled “Errors”| Status | Meaning | What to do |
|---|---|---|
401 |
The key is missing, malformed, revoked or expired. | Check the key, or create a new one. |
404 |
No ready deployment has this model name. | Check the name on the Inference page and that the deployment is ready. |
A request outside the key’s model aliases, or over its rate or concurrent-request limit, is refused with an error that names the reason. Use a key whose aliases include the model, or raise the key’s limits in the portal.
Limits
Section titled “Limits”- One endpoint per virtual machine, shared by every deployment on it.
- A key’s rate limit and concurrent-request limit are set per key. There is no platform-wide limit on top of them.
- Request bodies and model behaviour (context length, maximum tokens) are those of the deployed model.
- The endpoint is reachable from the internet on the virtual machine’s public address. To restrict access to specific source addresses, use the virtual machine’s firewall in the portal. See Virtual machines.
