> See the full index of documentation pages at https://docs.zettabyte.com/llms.txt.

# zSTUDIO API overview

> zSTUDIO's model API gives you a choice of models through one API, and you pay per token.

Source: https://docs.zettabyte.com/docs/maas/overview

Last updated: 2026-10-10

The API takes one request format at one path, so every call looks the same regardless of which model it names. Requests go to zSTUDIO, and zSTUDIO's API returns the reply of the model the request names. You name the model in each request, so one app or workflow can use a different model at each step, with the same code and the same API key.

That one format is OpenAI's Chat Completions format: existing code, SDKs and tools built for it work with zSTUDIO too. Point them at zSTUDIO's base URL, key and a model ID instead, as the sections below show.

## Start here

Pick the route that matches how you'll make your first call:

- From your own code, with the OpenAI SDK or curl: [Quickstart: call zSTUDIO with the OpenAI SDK](https://docs.zettabyte.com/docs/maas/quickstart).
- From an app or tool that has a custom endpoint setting for connecting to another model API: [Connect an app or tool to zSTUDIO](https://docs.zettabyte.com/docs/maas/connect-an-app-or-tool).

## Authentication

A call authenticates with your API key, sent as a Bearer token in the `Authorization` header. The OpenAI SDKs set that header for you from the key you pass them. A raw HTTP call sets it itself: the Headers section below shows both headers a call sends.

You can create more than one API key, for example one per app or environment, and each shows its own usage and limits. A key isn't tied to a model: the model is set in each request.

You create keys on the console's [**API Keys** page](https://app.zettabytecloud.com/API-key/list), and [API keys](https://docs.zettabyte.com/docs/inference-api/api-keys) has the steps. Keep the key secret: read it from an environment variable on your own machine or server rather than writing it into code that's shared or that runs on a user's device. [The quickstart](https://docs.zettabyte.com/docs/maas/quickstart) reads it from `ZSTUDIO_API_KEY`.

## Base URL

The base URL is `https://app.zettabytecloud.com/inference/v1`, and chat calls go to `https://app.zettabytecloud.com/inference/v1/chat/completions`. An OpenAI SDK takes the base URL and adds `/chat/completions` itself, so give an SDK or a tool the base URL. A raw HTTP call uses the chat URL as written.

The console's **API Access** field shows the address without `/v1`, so use the base URL here instead; [zSTUDIO API errors](https://docs.zettabyte.com/docs/maas/errors) says what happens with the shorter address.

## Headers

A raw HTTP call sends two headers: `Authorization` with your key, and `Content-Type` for its JSON body.

```text
Authorization: Bearer <key>
Content-Type: application/json
```

`<key>` stands for your zSTUDIO API key. The full call is in the quickstart.

## Request IDs

Responses carry a request ID in a response header, and the `401`, `403` and `503` error bodies also carry it in their message. Include the request ID when you report a problem with a call. The errors page shows where it appears.

## Errors and limits

These statuses each have their body, cause and fix on the errors page:

- `401`: a missing or wrong key.
- `403` with `code` `insufficient_user_quota`: a valid key on an account with no credit.
- `503` with `code` `model_not_found`: an unknown model ID.

If you're moving code that handled OpenAI's `429` for no credit, catch zSTUDIO's `403` with `code` `insufficient_user_quota` instead: the two APIs use different statuses for the same situation. [zSTUDIO API errors](https://docs.zettabyte.com/docs/maas/errors#403-insufficient-user-quota) has the handler in Python and Node.

A request field beyond `model` and `messages` can behave differently here than it does on OpenAI, so try it in a call of your own before building on it.

Each key has an RPM (requests per minute) and a TPM (tokens per minute) setting, shown on the console's **API Keys** page. The API keys page explains both settings.

## Moving existing OpenAI code?

Change three things, the base URL, the key and the model ID, and pass the key explicitly:

- Set `base_url` in Python or `baseURL` in Node to the value under Base URL. The Python SDK also reads a base URL from `OPENAI_BASE_URL`, but an explicit `base_url` is what the call uses.
- Pass your zSTUDIO key as `api_key` in Python or `apiKey` in Node. If no key is passed, both the Python and Node SDKs fall back to `OPENAI_API_KEY`, which would send the wrong key to zSTUDIO.
- Replace the model name with a zSTUDIO model ID from [zSTUDIO models and model IDs](https://docs.zettabyte.com/docs/maas/models) or the console's **Model Market**. The quickstart shows [how to find a model ID](https://docs.zettabyte.com/docs/maas/quickstart).

## Next steps

- [Quickstart: call zSTUDIO with the OpenAI SDK](https://docs.zettabyte.com/docs/maas/quickstart): make a first call from your own code.
- [Connect an app or tool to zSTUDIO](https://docs.zettabyte.com/docs/maas/connect-an-app-or-tool): connect an app or tool that isn't code.
- If a call fails: [zSTUDIO API errors](https://docs.zettabyte.com/docs/maas/errors) has each error's body, cause and fix.
