Get started
Build with Byta AI
One API for Byta text models and durable media-generation jobs. The interface uses familiar OpenAI request shapes where they fit, while image and video generation remain deliberately asynchronous for reliable production workloads.
Base URL
All public developer endpoints live on the dedicated API host. Requests to the main website’s /api path are not accepted.
Production
https://api.byta-ai.com/v1Authentication
Use a Byta API key as a Bearer token. Keep it on your server and never embed it in browser or mobile client code.
Authorization: Bearer $BYTA_API_KEY
API keys use a separate USD wallet
The key shares its Byta account identity and private output ownership, but API usage is charged only to the account's prepaid API USD balance. App credits are not shared. Rotating a key invalidates the previous value immediately.
Manage everything in the API Console
Open api.byta-ai.com to create keys, add funds, and review request usage. The live public model catalog is available at api.byta-ai.com/models.
Make your first request
Point the official OpenAI client at Byta’s base URL, or call the REST endpoint directly. Responses is the recommended text interface for new integrations.
Create a response
from openai import OpenAI
client = OpenAI(
api_key="YOUR_BYTA_API_KEY",
base_url="https://api.byta-ai.com/v1",
)
response = client.responses.create(
model="Byta-1.4",
input="Give me three names for a lunar travel company.",
)
print(response.output_text)Endpoint map
Text requests can complete in one connection. Media requests deliberately use a durable submit-and-poll contract.
| Capability | Endpoint | Response model |
|---|---|---|
| Responses | POST /v1/responses | JSON or SSE stream |
| Chat Completions | POST /v1/chat/completions | JSON or SSE stream |
| 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 |
| Music | POST /v1/music/generations | HTTP 202 asynchronous task |
| API billing balance | GET /v1/billing | Prepaid USD balance |
| Models | GET /v1/models | Authenticated model catalog |
Media job lifecycle
The foreground request ends before provider generation, download, and private storage begin.
1
Submit
Send prompt, model, and Idempotency-Key.
2
Accept
Receive 202, job ID, and status URL.
3
Poll
Check every 2–5 seconds until terminal.
4
Download
Fetch private output with the same key.
Choose a capability
Start with the guide for the output you need. Each guide includes model options, request fields, response shapes, and production retry behavior.
Generate text
Responses and Chat Completions with streaming, reasoning controls, and web search.
Read guideGenerate speech
Convert text to privately stored speech audio and download it securely.
Read guideGenerate music
Create durable instrumental or lyrics-based song tasks and poll for audio.
Read guideGenerate images
Create durable image jobs, poll their state, and download private outputs.
Read guideGenerate video
Submit asynchronous text-to-video or image-to-video jobs with model-specific options.
Read guideProduction checklist
| Concern | Recommendation |
|---|---|
| Secrets | Keep BYTA_API_KEY in server-side environment or secret storage. |
| Model options | Refresh GET /v1/models instead of assuming media settings never change. |
| Retries | Use exponential backoff and preserve the media Idempotency-Key. |
| Polling | Poll every 2–5 seconds and stop at completed or failed. |
| Downloads | Stream private files and keep the Bearer key out of public URLs. |
| Errors | Log error.code, error.param, requestId, and job ID without logging secrets. |
Legacy base paths are intentionally rejected
Use
https://api.byta-ai.com/v1. Requests tohttps://byta-ai.com/api are not supported.