Skip to main content
Use Floodgate’s OpenAI-compatible API at https://api.floodgate.dev/v1 for text, images, speech, and video. Native Messages, Gemini, and Wan APIs are also available.

Authentication

Send your model API key in the Authorization: Bearer YOUR_API_KEY header. Configure the key’s routing groups and budget before sending requests. Use a separate Personal Access Token for account APIs.

Reseller customer header

Approved resellers must send exactly one X-Floodgate-Customer-Id header on Chat Completions, Messages, Responses, and Responses compaction requests by default. Use a stable, case-sensitive customer reference of 1 to 128 ASCII letters, digits, underscores, or hyphens. Do not include personal data. The header requirement applies regardless of the model or routing group. Dashboard Playground requests are exempt. If your account is not approved, the header has no effect. See the reseller program for enrollment, examples, restrictions, and error handling.

Endpoints

Choose a model that supports the API you use. Model Square lists each model’s APIs and group prices. The video guide includes Wan’s native endpoints.

Reviewed Seedance and Kling endpoints

Use only operations currently available to your exact model and routing group in Model Square. Use https://api.floodgate.dev as the host for these native paths; do not add another /v1 prefix. Use the public task ID returned by Floodgate. The Seedance and Kling guides cover supported inputs, response fields, authenticated downloads and billing.

Chat Completions

Responses

Set an output-token limit in each text request. Use max_output_tokens for Responses, max_tokens for Messages, and the model’s supported max-token field for Chat Completions. Floodgate uses this limit to reserve funds before sending the request.

Native Messages

Streaming

Set "stream": true for a supported text request. Read the API’s server-sent events until the stream completes. If your client reads usage metadata, keep the final usage event. See Function tools for tool calls and Troubleshooting for request errors.

Native Gemini text

Use the accepted model ID in the path. For a reviewed Gemini text operation:
Replace YOUR_MODEL_ID with the accepted model ID, URL-encoded as a path segment. Text operations return their response directly; they do not use video task polling or downloads.

Response fields

These samples are illustrative. IDs, generated text and usage vary.
Extract Chat Completions text from choices[].message.content, Responses text from output message items with output_text content, Messages text from content blocks with type: "text", and Gemini text from candidate content parts.

Streaming completion signals

Gemini streaming requires the separately available :streamGenerateContent?alt=sse operation. Do not infer it from basic generation. Parse complete SSE frames across network chunk boundaries.

Parameters, limits and charges

The API tab shows the selected operation’s enforced token ceiling. That ceiling is not the model’s context or output capacity. Defaults and model-specific limits remain undocumented unless published for that model/group. Tools, vision, structured output and reasoning need their own confirmed capability. Protocol conversion does not establish lossless support for optional features. Usage is billed in the unit and rate of the group handling the request. Output-token budgets affect the initial reservation. See Model Square for rates and minimum charges. For 400, check required fields and token limits; 401, the API key; 403, group access and funds; 429, rate limits. Streaming failures can arrive as events after HTTP 200. See Troubleshooting.