# Build with Byta AI

Base URL: https://api.byta-ai.com/v1

OpenAPI 3.1: https://api.byta-ai.com/openapi.json

Byta exposes OpenAI-compatible text APIs, speech, account billing information, and durable asynchronous image, video, and music generation APIs. Requests to https://byta-ai.com/api are not accepted.

## Authentication

Send your Byta API key on every request:

~~~http
Authorization: Bearer YOUR_BYTA_API_KEY
~~~

Keep API keys on your server. The key identifies the account used for model access, prepaid USD billing, imported reference images, and private generated files.

## First request

~~~bash
curl https://api.byta-ai.com/v1/responses \
  -H "Authorization: Bearer $BYTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"Byta-1.4","input":"Give me three names for a lunar travel company."}'
~~~

## Endpoint map

| Capability | Endpoint | Behavior |
| --- | --- | --- |
| Responses | POST /v1/responses | Synchronous or SSE streaming text |
| Chat Completions | POST /v1/chat/completions | OpenAI-compatible messages and choices |
| Images | POST /v1/images/generations | HTTP 202 asynchronous job |
| Video | POST /v1/videos/generations | HTTP 202 asynchronous job |
| Speech | POST /v1/speech/generations | Synchronous private MP3 output |
| Music | POST /v1/music/generations | HTTP 202 asynchronous job |
| API billing balance | GET /v1/billing | Separate prepaid USD balance |
| Models | GET /v1/models | Authenticated active model catalog |

## API Console

Open https://api.byta-ai.com/ to create and rotate keys, add funds, and inspect metadata-only request usage. The live public model and pricing catalog is available without signing in at https://api.byta-ai.com/models.

## Media job lifecycle

1. Submit with a unique Idempotency-Key.
2. Receive HTTP 202 and a statusUrl.
3. Poll every 2–5 seconds until completed or failed.
4. Download private files with the same Bearer key.

See the model, pricing, text, image, and video guides for complete configuration tables and examples.
