Browse documentation

Get started

Build with Byta AI

View as Markdown
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/v1

Authentication

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.
CapabilityEndpointResponse model
ResponsesPOST /v1/responsesJSON or SSE stream
Chat CompletionsPOST /v1/chat/completionsJSON or SSE stream
ImagesPOST /v1/images/generationsHTTP 202 asynchronous job
VideoPOST /v1/videos/generationsHTTP 202 asynchronous job
SpeechPOST /v1/speech/generationsSynchronous private MP3
MusicPOST /v1/music/generationsHTTP 202 asynchronous task
API billing balanceGET /v1/billingPrepaid USD balance
ModelsGET /v1/modelsAuthenticated 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.

Production checklist

ConcernRecommendation
SecretsKeep BYTA_API_KEY in server-side environment or secret storage.
Model optionsRefresh GET /v1/models instead of assuming media settings never change.
RetriesUse exponential backoff and preserve the media Idempotency-Key.
PollingPoll every 2–5 seconds and stop at completed or failed.
DownloadsStream private files and keep the Bearer key out of public URLs.
ErrorsLog 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.