Browse documentation

Model capabilities

Generate text

View as Markdown
Use the Responses API for new text integrations or Chat Completions when an existing OpenAI-compatible client already expects messages and choices. Both interfaces use the same Byta chat runtime, billing, reasoning controls, and streaming transport.
OpenAI client compatibleTry in chat

Choose a model

Use the authenticated GET /v1/models catalog as the source of truth. Newly advertised chat models work here automatically when their configured upstream speaks the Responses protocol.

Catalog-driven routing

Model IDs, context limits, output limits, reasoning choices, and prices can change independently of this page. Read them from GET /v1/models before presenting a model picker or validating a request.

Context and output limits

The context window includes system instructions, conversation history, tool context, and reserved output space.
Inspect maxInputTokens, maxOutputTokens, andsafetyMarginTokens on each catalog entry.

Create a response

Send text as a string or a role-based input array. The response includes standard output items and token usage.
POST/v1/responses
JSON · optional SSE stream
Responses API
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.5",
    instructions="You are a concise product strategist.",
    input="Write a one-sentence positioning statement for a private AI workspace.",
)

print(response.output_text)

Compact a conversation

Shrink a long Responses conversation into a canonical input item that can be passed verbatim to the next response request.
POST/v1/responses/compact
JSON response
cURL · compaction
curl https://api.byta-ai.com/v1/responses/compact \
  -H "Authorization: Bearer $BYTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"Byta-1.5","input":[{"role":"user","content":"Compact this conversation."}]}'

Preserve the returned state

Send the returned output array unchanged as input to the nextPOST /v1/responses call. Byta does not parse or rewrite encrypted reasoning and compaction state.

Core parameters

modelrequired
string

An active chat model returned by GET /v1/models.

inputrequired
string | array

Plain text, role-based messages, or Responses protocol items such as function_call_output.

instructionsoptional
string

High-level system or developer instructions.

max_output_tokensoptional
integer

Positive upper bound for generated output tokens.

reasoning.effortoptional
string

A /v1/models catalog value or model-specific alias from the table below.

toolsoptional
array

Responses tools supported by the selected model, including function tools and web search.

streamoptional
boolean

Return typed server-sent events as output is generated.

Reasoning labels and API aliases

The Chat UI shows friendly labels. API clients can send the corresponding catalog value returned by GET /v1/models or one of its case-insensitive aliases. The exact aliases are model-specific and shown below.
EndpointRequest fieldExample
POST /v1/responsesreasoning.effort"reasoning": {"effort": "balanced"}
POST /v1/chat/completionsreasoning_effort"reasoning_effort": "pro"

When reasoning is omitted

An API request that omits reasoning sends no explicit effort, so the selected model's upstream default applies. Use a value advertised in that model'sreasoningEfforts array when behavior must be explicit.

Analyze images

All advertised Byta chat models accept image input through the Responses API. Images stay typed as vision parts and their upstream vision tokens are included in input usage and billing.
Python · image input
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.5-pro",
    input=[{
        "role": "user",
        "content": [
            {"type": "input_text", "text": "Describe this image."},
            {
                "type": "input_image",
                "image_url": "https://example.com/photo.jpg",
                "detail": "high",
            },
        ],
    }],
)

print(response.output_text)
print(response.usage.input_tokens)
LimitValue
EndpointPOST /v1/responses
FormatsJPEG and PNG
ImagesUp to 20 per request
Size20 MiB per image and 20 MiB total inline image bytes
Detailauto, low, or high
BillingUpstream-reported vision tokens are included in input_tokens

Use the final usage

Final billing uses the selected upstream's returned input_tokens, including image tokens. If upstream usage is unavailable, Byta falls back to the GPT 32px-patch estimate. Base64 transport bytes are never counted as text tokens.

Stream text

Set stream to true for incremental output. Stop reading after response.completed, or close the connection to cancel the active upstream request.
Python · streaming
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_BYTA_API_KEY",
    base_url="https://api.byta-ai.com/v1",
)

with client.responses.stream(
    model="Byta-1.5-pro",
    input="Explain why idempotency matters in an asynchronous API.",
) as stream:
    for event in stream:
        if event.type == "response.output_text.delta":
            print(event.delta, end="", flush=True)

Streaming events

Text arrives in response.output_text.delta events. The terminalresponse.completed event includes final usage.

Responses stream events

EventMeaning
response.createdThe response object was accepted.
response.output_item.addedAn assistant output item started.
response.output_text.deltaIncremental text content.
response.output_text.doneText for the output item is complete.
response.completedTerminal response with final usage.
response.failedTerminal model or transport failure.

Chat Completions

Use this text-only endpoint for clients built around messages, choices, and chat.completion response objects. Send image input through POST /v1/responses.
POST/v1/chat/completions
JSON · optional SSE stream
cURL · Chat Completions
curl https://api.byta-ai.com/v1/chat/completions \
  -H "Authorization: Bearer $BYTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Byta-1.5",
    "messages": [
      {"role": "system", "content": "Answer with one short paragraph."},
      {"role": "user", "content": "What makes a good API error message?"}
    ]
  }'

Errors

Errors use an OpenAI-style envelope with message, type, param, and code.
CodeMeaningWhat to do
invalid_api_keyBearer key is missing or invalid.Create or rotate a user API key.
model_not_foundThe model is not public or enabled.Use GET /v1/models and select an active text model.
unsupported_content_typeA content part is not supported by the selected model.Use a supported Responses item type.
model_not_responses_capableThe catalog route is not backed by a Responses endpoint.Choose another live model or ask the operator to correct its upstream route.
unsupported_parameterThe request uses an unsupported option such as n != 1.Adjust the named parameter.
invalid_imageAn image URL or inline payload is malformed.Use a public HTTPS URL or a valid JPEG/PNG data URL.
image_limit_exceededThe request contains too many images.Reduce the request to the advertised image limit.
model_request_failedThe internal model request could not complete.Retry with bounded exponential backoff.