FOR DEVELOPERS

SeaGenera documentation.

Models, parameters, and streaming responses through one API.

Manage API keys
01

Quickstart

Create a key in your account and top up your balance in the top-up section. Specify a text model ID from the catalog.

POST/v1/chat/completionsJSON or SSE

Base URL: . Keep your key in the environment variable SEAGENERA_API_KEY on your application’s server.

02

Authentication

Pass your SeaGenera key in the header Authorization: Bearer YOUR_SEAGENERA_KEY. The POST body is JSON, with the header Content-Type: application/json.

The full key is shown only when it is created. You can revoke it in your account. Browser requests from the Playground use your account session.

03

Model catalog

GET/v1/models

Returns the SeaGenera text, image, video, and audio models: id, owned_by, context_length and pricing with prices in rubles. For media, the field media contains the format, available parameters, and voices. Requires a SeaGenera API key. Use id in the field model.

Model list

The model card lists capabilities, supported parameters, and examples. The field supported_parameters in the catalog describes model capabilities; some are not yet available through the SeaGenera API.

04

Request parameters

Required fields: model and messages. Supply other fields as needed. Unknown fields, invalid types, and parameters not supported by the selected model return error 400.

Field / typeValuesDescription

When max_tokens is omitted, the provider chooses the response length and the reserve uses the selected model’s limit. The default is stream: false. Set max_tokens explicitly to limit the reserve.

Message text

messages supports roles system, developer, user, assistant and tool. content is a string or an array of content parts text, image_url, file, input_audio, video_url. Check the selected model’s input types in seagenera_capabilities.

{
  "messages": [
    { "role": "system", "content": "Отвечай кратко на русском языке." },
    { "role": "user", "content": "Как работает streaming?" }
  ]
}
05

Streaming

SSE

Set stream: true. The response content type is text/event-stream and it arrives in chunks. In cURL, use -N, to disable buffering.

choices[].delta.content

A new text fragment.

usage

Tokens and the confirmed cost, when available.

[DONE]

End of stream.

data: {"choices":[{"index":0,"delta":{"content":"Привет"}}]}

data: {"choices":[],"usage":{"prompt_tokens":12,"completion_tokens":34,"cost_rub":0.013585,"cost":0.013585,"cost_currency":"RUB"}}

data: [DONE]

Network chunk boundaries do not match SSE event boundaries. Use an SSE parser that handles comments, multiline events, and UTF-8 fragments.

JavaScript · Node.js 18+ · npm install eventsource-parser

Save the example as client.mjs and run node client.mjs after installing eventsource-parser version 3. Set SEAGENERA_API_KEY in the environment before running it. This example performs a paid generation.

To stop, use AbortController.abort(). Keep the text already received. Stopping does not guarantee zero cost: completed generation is billed at the confirmed cost.

Once streaming starts, the HTTP status may already be 200. Check chunk.error and choices[].finish_reason === "error". If the stream ends without [DONE], treat the response as incomplete.
06

Data masking

Text request: POST /v1/chat/completions with pii_redaction: true or enable masking for an API key in your account. Playground enables the switch by default. The key setting applies to all its text requests: false cannot disable masking enabled for the key.

{
  "model": "MODEL_ID",
  "messages": [{"role": "user", "content": "Напиши письмо на anna@example.com"}],
  "pii_redaction": true,
  "stream": true
}

SeaGenera replaces detected values in messages[].content and stop with temporary markers. Markers returned unchanged by the model are restored in output text, including streaming and reasoning. Mappings exist only in memory during request processing.

The header X-SeaGenera-PII-Redaction: enabled confirms the mode is enabled, X-SeaGenera-PII-Count is the number of unique detected values, not a safety assessment. Masking supports plain text output; combining it with json_object or json_schema is rejected before generation and balance reservation. Use a key without masking for JSON.

Detection runs on the SeaGenera server without a separate external service. Supported patterns include emails, common phone formats, Russian passport numbers with 4 and 6 digits, and SNILS formatted as 123-456-789 01. INN with 10 or 12 digits, and unformatted SNILS or passport numbers, require their respective labels. Names of 2–4 words require a ФИО:, полное имя: or full name: label. Addresses require адрес: or address:, ending at a newline or semicolon, up to 240 characters.

This pattern-based detector can miss data or replace too much. It does not process images, video, audio, PDFs or speech recognition results. Personal data and Russian data protection law.

07

Structured outputs

response_format.type accepts text, json_object or json_schema. The model must support response_format, and JSON Schema also requires structured_outputs.

With json_object explicitly ask the model to return JSON. With json_schema supply name and schema; strict and description are optional.

Request body fragment
{
  "response_format": {
    "type": "json_schema",
    "json_schema": {
      "name": "answer",
      "strict": true,
      "schema": {
        "type": "object",
        "properties": { "answer": { "type": "string" } },
        "required": ["answer"],
        "additionalProperties": false
      }
    }
  }
}

Individual streamed JSON fragments may be invalid. Collect the full text, then call JSON.parse().

08

Reasoning

Use reasoning only with models that support it. Choose effort or max_tokens; do not supply both fields at once. The reasoning budget must fit within the total output limit.

{
  "reasoning": { "effort": "high", "exclude": true },
  "max_tokens": 1024
}

The levels none, minimal, low, medium, high, xhigh, max depend on the model. Use the values listed in its card. exclude controls whether reasoning is returned, enabled controls whether reasoning is enabled.

reasoning_effort and include_reasoning are alternative fields. Do not combine them with the object reasoning. Whether reasoning text is returned depends on the model.

09

Errors

{
  "error": {
    "message": "Описание ошибки",
    "type": "invalid_request"
  }
}
CodeCauseWhat to check
400Invalid requestModel, types, and supported parameters.
401UnauthorizedThe key has not been revoked; the Bearer header is present.
402Insufficient balanceBalance and reserve for the selected model.
403Access deniedAccount permissions and access to the site.
404Job not foundThe job ID and owner account.
409Conflict or repeated operationThe operation key and the result of the existing request.
410File no longer availableThe retention period and any previously downloaded copy.
413 / 415Body size or formatJSON size and Content-Type.
429Rate limitWait before retrying.
502 / 503 / 504Service or provider unavailableGeneration status; contact support if the error persists.

After a timeout or disconnection, check the request history. Do not retry generation automatically while its result and cost are still being confirmed.

A confirmed failure with no result incurs no customer charge and releases the reserve. If a failure leaves the result unknown, verification lasts 30 minutes, then the reserve is released. SeaGenera covers any late provider costs in these cases. A delivered partial result or user cancellation is reconciled separately.

For a failed media job, error.code and error.message explain the reason. balance_released: true together with usage.cost_rub: 0 confirm that the reserve was released. release_after is the automatic release time for an uncertain operation (Unix seconds), or null. Checking the operation never submits another paid generation.

10

Limits and pricing

  • Up to 20 requests per minute and 5 unfinished generations per account.
  • Limits are shared across the website and all API keys on the account.
  • 1–1024 messages; up to 8 MiB of UTF-8 text.
  • Requests are limited to 15 MiB including base64, schemas and options. Up to 32 attachments; Playground accepts up to 10 MiB of uploaded files.
  • The output limit is model-specific: seagenera_capabilities.max_output_tokens. When max_tokens is omitted, the provider chooses the output length and the reserve covers the model limit. Choose a smaller budget in Playground.

SeaGenera balances and prices are in rubles. An amount is reserved based on the selected model’s prices and limits before each request. The confirmed cost is charged on completion and the unused reserve is returned. If the cost is unknown, the reserve remains until reconciliation.

usage.cost_rub — the confirmed charge in rubles. In a text JSON response or streaming event, this field may be absent until the cost is confirmed. An absent field or null does not mean the request is free. The amount is rounded up once to 0.000001 ₽. Rates in pricing are per unit: token, image, second, or another unit shown on the model card. The fields pricing_currency and cost_currency are set to RUB. Tokens measure processing volume, not your balance.

Your balance does not change with exchange rate changes. The conversion rate and markup are fixed when a request is accepted and applied to the confirmed provider cost at final settlement, even if generation finishes later.

Attachments, tools and search

Images, PDFs and videos accept data URLs or public HTTPS URLs; input_audio contains base64 and format. Attachments are sent to the model provider. SeaGenera does not fetch those URLs or store uploads. Text files in Playground become message text.

{"model":"MODEL_ID","messages":[{"role":"user","content":[{"type":"text","text":"Describe the image"},{"type":"image_url","image_url":{"url":"https://example.com/image.png"}}]}],"max_tokens":8192}

PDFs: use a file-parser plugin with pdf.engine: native for file-capable models, or cloudflare-ai for text extraction. If omitted, the server explicitly selects one of these engines. Paid mistral-ocr is never enabled automatically.

Tools: tools, tool_choice and parallel_tool_calls. The model returns tool_calls; the client executes functions and submits role: tool messages with matching tool_call_id values. SeaGenera never executes functions, commands or code on the VDS. In Playground, define tools in JSON options and enter results manually to continue.

Search: plugins: [{"id":"web","engine":"exa","max_results":5}]. Engines: native, exa, firecrawl, parallel, perplexity. Native availability is listed in seagenera_capabilities.web_search_engines. For native search, set max_tool_calls (1–30, default 30); Playground suggests 1 call. The reserve covers search and additional model turns. Citations are returned in annotations.

For attachments and search, the reservation uses input context capacity because file size cannot determine token count. It may substantially exceed the final cost. Only confirmed cost is charged; unused credit is returned. An error after search or file processing does not imply zero cost.

PII masking supports plain text chat only. Disable it for attachments, tools and JSON; keys with mandatory masking reject these requests before contacting the provider.

The response timeout is 10 minutes. Paid generations are never automatically retried. Upload size, request rate and concurrency are service limits separate from model capabilities.

11

Images, video, and audio

All methods use the same SeaGenera key and ruble balance. Each request must include model from the catalog and idempotency_key — a unique operation key of 16–64 letters, digits, or the symbols _ or -. Reuse the same key when delivering the same request again. Changed parameters require a new key.

MethodInputResult
POST /v1/imagesmodel, prompt, n; settings from media.parameters for the selected model.JSON: data[].b64_json, data[].media_type, usage.cost_rub.
POST /v1/videosmodel, prompt, duration, resolution, aspect_ratio; generate_audio and seed if supported by the model.HTTP 202: id, status, polling_url.
POST /v1/audio/speechmodel, input, voice, response_format: "mp3" | "pcm".MP3 or PCM. Headers X-SeaGenera-Request-Id and X-Cost-Rub.
POST /v1/audio/transcriptionsmodel, input_audio: {data, format}, optionally language.JSON: text and usage.cost_rub.
POST /v1/audio/generationsmodel, input, voice, max_tokens.JSON: audio.data (base64, format in audio.format), text, usage.cost_rub.

Receiving and downloading results

Images, audio and transcriptions are returned in the API response. Direct API requests do not add files to My generations. Prompts, text conversations and source uploads are not written to persistent application storage.

Completed Playground images, audio and video are saved privately in My generations for 7 days after completion. Download files before the displayed deletion date. If saving fails, download the result immediately.

Video generation is asynchronous. Completion checks, billing and saving Playground video continue without an open browser. Retrying a file download does not create a new generation. External suppliers set their own retention periods; direct API video availability depends on the supplier.

For text, Playground calculates an estimated reserve without calling the model. My generations shows the total request cost and deletion date. Settings can be reused in the current tab; after reloading, you can select the same model but must enter the prompt again. Generating again is charged separately.

Images

prompt — up to 32,000 characters. Up to 10 images per request, subject to the model’s lower limit. Choose resolution, aspect ratio, quality, background and file format from media.parameters. Pass a reference in input_references: an array of objects {"type":"image_url","image_url":{"url":"data:image/png;base64,..."}}. Up to 32 references, PNG, JPEG or WebP up to 2 MB each, or public HTTPS URLs. Individual models may accept fewer references.

{
  "model": "bytedance-seed/seedream-5-0-flash",
  "prompt": "Волны у скалистого берега на рассвете",
  "resolution": "1K",
  "aspect_ratio": "16:9",
  "n": 1,
  "idempotency_key": "unique-image-request-0001"
}

Video: creation, status, and download

Submit the request, then call GET using polling_url from the response with the same Bearer key. Statuses: pending, in_progress, completed, failed, uncertain. Check every 10–30 seconds. When the status is completed the response includes content_url — a protected MP4 or WebM video URL within SeaGenera. The uncertain status means the result is not yet confirmed; do not automatically start a new paid operation.

{
  "model": "bytedance/seedance-2.0-fast",
  "prompt": "Камера медленно приближается к морскому берегу",
  "duration": 5,
  "resolution": "480p",
  "aspect_ratio": "16:9",
  "idempotency_key": "unique-video-request-0001"
}

GET /v1/videos/{id} returns the job status, reserve, and confirmed cost. GET /v1/videos/{id}/content returns the completed video. Only the job owner can access it. Supported first frame: frame_images: [{"type":"image_url","image_url":{"url":"data:image/jpeg;base64,..."},"frame_type":"first_frame"}]. last_frame is also available; both frames may be supplied. Alternatively, use input_references for style guidance when supported. Frames take precedence when both are supplied. File availability depends on the model; download the video when ready. You can return to the job from your account history.

Video continuation: when media.parameters includes previous_job_id, pass the ID of your own completed SeaGenera job from the same model, no older than 7 days. The reserve includes processing the source video. The model provider makes the final availability check.

Speech and audio responses

Speech: input up to 32,000 characters, voice from media.voices or a known voice ID. response_format: mp3 or pcm; instructions up to 4,000 characters and speed 0.25–4 where supported. PCM is raw audio for download and processing. Audio responses: /v1/audio/generations with text up to 32,000 characters, a voice and max_tokens from 64 to the model limit.

Provider-specific options are passed in provider.options. Allowed names are listed per model in the catalog provider_options; unknown fields are rejected. Video supports size, first/last frames and image_url, audio_url, video_url input_references according to the model input modalities.

Image streaming: stream: true when media.streaming is available. SSE contains image_generation.partial_image, image_generation.completed, followed by seagenera.completed and [DONE]. Partial images are not completed results. Only completed images enter the archive.

Models with text and image output support conversations through /v1/chat/completions with modalities: ["text","image"] and image_config. History can include assistant.images. You may also pass messages to /v1/images or Playground advanced options: the response contains images and text, and Playground files are retained for 7 days. This mode requires stream: false.

Audio conversations: /v1/audio/generations accepts input and input_audio or messages with history. response_format: mp3, wav, flac, opus, pcm16. GPT Audio streaming through /v1/chat/completions uses audio.format: pcm16 and stream: true. If conversion fails, the original PCM16 is returned with audio.conversion_error: true.

For detailed transcription, set response_format: verbose_json and timestamp_granularities: ["word","segment"]. The segments, words, language, duration and confidence fields are preserved when returned by the provider. Configure diarization through provider options.

Speech recognition

Pass the file in JSON: input_audio.data — base64 without a prefix data:, input_audio.format — wav, mp3, flac, ogg, webm, m4a, aac, aiff. Limits: 25 MiB of source audio, 36 MiB of JSON, up to 24 hours subject to provider support. WAV: PCM or float, mono/stereo; MP3: MPEG Layer III. language — an optional language code, such as ru. The result contains the transcribed text.

Pricing, retries, and storage

The Playground shows the reserve before generation. For image models billed by tokens, it is based on the model’s maximum output and may significantly exceed the final cost. Unused reserves are returned after the cost is confirmed. If usage.cost_rub is null or X-Cost-Rub is pending, settlement is still in progress. The final charge is available in history.

Repeating POST /v1/videos with the same operation key returns the same job. Repeating an image or audio request with the same body returns HTTP 409 and a job object with id, status, billing_status and replayed: true; it does not generate another result. Download direct API image or audio results when received: POST does not return the file again. Playground files are available separately in My generations during their retention period. Videos can be opened from history while the provider makes them available. After an unconfirmed timeout, the reserve is held until the cost is resolved; do not automatically create a new operation.

Images are returned in full or via SSE when the model supports stream: true. Audio endpoints return a complete result; video uses status polling. Text streaming is available through /v1/chat/completions. Embeddings, reranking and decisions are available through the API; these tabs are not present in Playground.

Open Playground

Step-by-step examples

These examples use models from the current catalog. Before running them, check supported parameters through GET /v1/models or the model card. All POST examples make paid requests; set max_tokens where available.

Save the chosen JSON as request.json. Replace /v1/images in the command below with the endpoint shown above the example. Your server reads the SeaGenera key from its environment. Depending on the endpoint, response.out contains JSON, an audio file, or an SSE stream.

cURL
curl --fail-with-body -N https://seagenera.com/v1/images \
  -H "Authorization: Bearer $SEAGENERA_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @request.json \
  --output response.out

In media examples, replace idempotency_key with a new UUID for each new operation. Keep the original key and body when redelivering the same request. IMAGE_BASE64, WAV_BASE64 and PREVIOUS_JOB_ID are placeholders; do not send them literally.

1. A tool call and the follow-up response

Send the function definition. tool_choice: required requests a tool call; your application executes the function after validating its name and arguments.

POST /v1/chat/completions · JSON
{
  "model": "openai/gpt-6-luna",
  "messages": [
    {
      "role": "user",
      "content": "Use sum to add 7 and 8."
    }
  ],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "sum",
        "description": "Add two integers",
        "parameters": {
          "type": "object",
          "properties": {
            "a": {
              "type": "integer"
            },
            "b": {
              "type": "integer"
            }
          },
          "required": [
            "a",
            "b"
          ],
          "additionalProperties": false
        }
      }
    }
  ],
  "tool_choice": "required",
  "max_tokens": 256
}

Read choices[0].message.tool_calls from the response. The next JSON illustrates the result of sum(7, 8). In a real request, preserve the original assistant message, including reasoning_details when present, and replace call_example with the actual tool_calls[].id. Add a separate tool message for every call.

POST /v1/chat/completions · JSON
{
  "model": "openai/gpt-6-luna",
  "messages": [
    {
      "role": "user",
      "content": "Use sum to add 7 and 8."
    },
    {
      "role": "assistant",
      "content": null,
      "tool_calls": [
        {
          "id": "call_example",
          "type": "function",
          "function": {
            "name": "sum",
            "arguments": "{\"a\":7,\"b\":8}"
          }
        }
      ]
    },
    {
      "role": "tool",
      "tool_call_id": "call_example",
      "content": "15"
    }
  ],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "sum",
        "description": "Add two integers",
        "parameters": {
          "type": "object",
          "properties": {
            "a": {
              "type": "integer"
            },
            "b": {
              "type": "integer"
            }
          },
          "required": [
            "a",
            "b"
          ],
          "additionalProperties": false
        }
      }
    }
  ],
  "tool_choice": "auto",
  "max_tokens": 256
}

2. Editing an image in a conversation

First create an image through /v1/chat/completions with modalities: ["text", "image"], stream: false and a user message. Then pass the history and the assistant message from the response, including images. Replace IMAGE_BASE64 with the actual PNG data from the previous response. If the response contains JPEG or WebP, preserve its actual MIME type.

POST /v1/chat/completions · JSON
{
  "model": "google/gemini-nano-banana-2.1",
  "modalities": [
    "text",
    "image"
  ],
  "stream": false,
  "max_tokens": 4096,
  "image_config": {
    "aspect_ratio": "1:1",
    "image_size": "1K"
  },
  "messages": [
    {
      "role": "user",
      "content": "Draw a blue boat on a calm sea."
    },
    {
      "role": "assistant",
      "content": "Here is the boat.",
      "images": [
        {
          "type": "image_url",
          "image_url": {
            "url": "data:image/png;base64,IMAGE_BASE64"
          }
        }
      ]
    },
    {
      "role": "user",
      "content": "Keep the composition, but make the boat red."
    }
  ]
}

Read choices[0].message.content and choices[0].message.images[].image_url.url. The data URL contains the file type and base64 data. For /v1/images with messages, use the same history and a new idempotency_key: results appear in data[].b64_json and text. This /v1/images mode requires stream: false and n: 1.

3. Creating and continuing a video

POST /v1/videos · JSON
{
  "model": "bytedance/seedance-2.5",
  "prompt": "A small blue boat moves slowly across a calm sea.",
  "duration": 4,
  "resolution": "480p",
  "aspect_ratio": "16:9",
  "generate_audio": false,
  "idempotency_key": "replace-with-new-uuid-video-1"
}

Save id and polling_url from the HTTP 202 response. GET polling_url with the same Bearer key every 10–30 seconds until completed. Then replace PREVIOUS_JOB_ID with this job’s SeaGenera id. The job must belong to your account, use the same model, and have completed no more than 7 days ago.

POST /v1/videos · JSON
{
  "model": "bytedance/seedance-2.5",
  "prompt": "Continue the boat movement with the same lighting.",
  "duration": 4,
  "resolution": "480p",
  "aspect_ratio": "16:9",
  "generate_audio": false,
  "idempotency_key": "replace-with-new-uuid-video-2",
  "previous_job_id": "PREVIOUS_JOB_ID"
}

Continuation creates a new paid job with a new id. Its reserve includes processing the source video and may be much higher than the price of a short new clip. If the status is uncertain, do not create another operation: check history and contact support. Download the completed file with an authenticated GET to content_url.

4. Provider options and transcript speakers

provider.options uses the provider identifier from the selected model’s provider_options. Here, azure.diarization enables speaker separation. SeaGenera validates allowed names; the provider makes the final check of supported values. Do not reuse these settings with another model without checking the catalog.

POST /v1/audio/transcriptions · JSON
{
  "model": "microsoft/mai-transcribe-2",
  "input_audio": {
    "data": "WAV_BASE64",
    "format": "wav"
  },
  "response_format": "verbose_json",
  "timestamp_granularities": [
    "word",
    "segment"
  ],
  "provider": {
    "options": {
      "azure": {
        "diarization": {
          "enabled": true
        }
      }
    }
  },
  "idempotency_key": "replace-with-new-uuid-transcript"
}

WAV_BASE64 is the base64 encoding of the complete WAV file, including its header, without a data: prefix. Read text, segments and words; use speaker, confidence and timestamps only when present. Downloading a transcript does not save it to My generations.

5. Audio input and audio output

POST /v1/audio/generations · JSON
{
  "model": "openai/gpt-audio-mini",
  "input": "Reply briefly to what you hear.",
  "input_audio": {
    "data": "WAV_BASE64",
    "format": "wav"
  },
  "voice": "alloy",
  "response_format": "flac",
  "max_tokens": 256,
  "idempotency_key": "replace-with-new-uuid-audio"
}

Decode audio.data from base64. Read the file type from audio.media_type and use the actual audio.format for its extension. If audio.conversion_error: true, the response contains PCM16: do not save it with a FLAC extension. The text field contains the textual response when supplied by the model.

6. Speech with multiple voices

POST /v1/audio/speech · JSON
{
  "model": "google/gemini-3.8-flash-lite-tts",
  "input": [
    {
      "text": "Hello from SeaGenera.",
      "voice": "Puck"
    },
    {
      "text": "Welcome to the playground.",
      "voice": "Zephyr"
    }
  ],
  "response_format": "pcm",
  "idempotency_key": "replace-with-new-uuid-speech"
}

This example returns binary PCM audio, not JSON. Save response.out as result.pcm; X-Cost-Rub contains the confirmed cost or pending. Select voices from media.voices. A list of turns is supported only by the relevant catalog models.

7. Streaming image generation

POST /v1/images · JSON
{
  "model": "openai/gpt-image-2.5-flare",
  "prompt": "A blue boat icon on a white background. No text.",
  "quality": "low",
  "n": 1,
  "stream": true,
  "idempotency_key": "replace-with-new-uuid-image"
}

Check the model’s media.streaming flag. Read the response with an SSE parser: partial_image is for previews, completed contains the finished image, and seagenera.completed reports the final status, cost and archive state. Also check error events and the error field; a preview does not guarantee success. The final marker is [DONE].

For token-priced image models, the reserve may be large even with quality: low. This example does not guarantee a small charge. The direct API does not save images to My generations: download the completed result immediately.

Using the examples in Playground

Choose the mode and model. For media, open Advanced settings → Additional JSON parameters and paste the example fields without model and idempotency_key: the form sets those two values. JSON can override the other form fields. Check the displayed reserve before submitting. For text tools, define tools in the advanced parameters and enter the tool result when Playground requests it.

Embeddings and decisions

These endpoints use your regular API key, balance and shared concurrency limit. Responses are JSON without streaming. Keys with mandatory masking cannot use these endpoints.

POST/v1/embeddings

Embeddings: input accepts text, a text array, tokens, or an array of content objects with model-supported attachments. Up to 128 items per batch. Optional fields: dimensions, encoding_format (float or base64), input_type.

POST/v1/rerank

Reranking: query, documents (up to 1,000 strings or text objects), and optional top_n. The response contains results with indices and relevance scores.

POST/v1/decisions

Decisions: state is text or JSON; questions contains up to 64 named questions. Types: noul (probability), choice (selection from criteria), score (ordered criteria levels). The response contains answers and usage.

JSON bodies for these endpoints are limited to 8 MiB. If cost is unconfirmed, the reserve remains until reconciliation; repeating a request creates a separate billable operation.

Gemini TTS and Fish S2 accept input as an array of text turns with voice and instructions. Fish S2 accepts one short audio reference for a single text through input_references. Senders must have permission to use the references. In Playground, set these fields in advanced JSON options.