Skip to navigation

Text API

View as Markdown
  • BeatAPI serves its text models as a synchronous, token-metered API. Keep one BeatAPI key and send the request format your application already uses.
  • One key for every text model, and one base URL: https://direct.beatapi.io (recommended) or https://api.beatapi.io (fallback).
  • Four request formats: OpenAI Chat Completions, OpenAI Responses, Anthropic Messages and Gemini native. Which one you use depends on the family; see the table below.
  • Text calls return JSON immediately or stream server-sent events. They never create an asynchronous BeatAPI task.
  • GET /v1/text/models is public: read model IDs, context windows, output limits and prices without a key.

Use https://direct.beatapi.io as the base URL for text requests: it is not subject to Cloudflare’s 100-second limit, so a long non-streaming request is not cut off. https://api.beatapi.io also works and is the fallback if direct.beatapi.io is unreachable from your network. The key, models and prices are the same on both. Image and video APIs use https://api.beatapi.io only.

Choose a protocol

ProtocolsEndpointSDKFamilies
OpenAI Chat CompletionsPOST /v1/chat/completionsOpenAI SDK (chat.completions)GPT, Gemini, Grok, DeepSeek, GLM, Qwen, Kimi, MiniMax, MiMo, Hunyuan, Muse
OpenAI ResponsesPOST /v1/responsesOpenAI SDK (responses)GPT, Gemini, Grok, DeepSeek, GLM, Qwen, Kimi, MiniMax, MiMo, Hunyuan, Muse
Anthropic MessagesPOST /v1/messagesAnthropic SDK (messages)Claude, Gemini, Grok, DeepSeek, GLM, Qwen, Kimi, MiniMax, MiMo, Hunyuan, Muse
Gemini nativePOST /v1beta/models/{model}:generateContentGemini SDK or plain HTTPGemini

Base URL and authentication

Use https://direct.beatapi.io for text requests; it is not subject to Cloudflare’s 100-second limit. https://api.beatapi.io is the fallback. Send the key in the header your SDK already uses; they all identify the same BeatAPI account and USD balance. The key works with or without the sk- prefix.

FormatKey header
OpenAI Chat Completions, OpenAI ResponsesAuthorization: Bearer <BEATAPI_API_KEY>
Anthropic Messagesx-api-key: <BEATAPI_API_KEY>, or Authorization: Bearer
Gemini nativex-goog-api-key: <BEATAPI_API_KEY>, or Authorization: Bearer

Store permanent BeatAPI API keys on trusted servers. Never ship them in a browser or mobile app.

Which format to use for which model

  • GPT is called on OpenAI Chat Completions or OpenAI Responses. For new reasoning and tool-calling integrations, Responses is the recommended format.
  • Claude is called on Anthropic Messages (POST /v1/messages).
  • Gemini can be called in all four formats: Chat Completions, Responses, Anthropic Messages and Gemini native.
  • Every other family can be called on Chat Completions, Responses and Anthropic Messages. Messages requests carry the anthropic-version header. If you are unsure, use Chat Completions.

Quick start

curl --request POST \
--url https://direct.beatapi.io/v1/chat/completions \