Chat models
Call Claude, Gemini, DeepSeek, GLM, Grok and Kimi through the PopNow API with the OpenAI, Anthropic or Gemini SDK you already use. One API key, priced per token in USD.
The PopNow API also runs chat models: Claude, Gemini, DeepSeek, GLM, Grok and Kimi. You call them through the protocols your code already speaks — OpenAI Chat Completions and Responses, Anthropic Messages and Gemini generateContent — so the official SDKs work once you change the base URL. They use the same sk-popnow- key and the same separate API USD balance as API images, video and audio. It starts at $0; add funds in API billing. Website credits cannot fund these calls.
Chat calls are synchronous: you get the reply (or a stream) in the same response. There is no task to poll.
At a glance
| OpenAI base URL | https://api.popnow.ai/v1 (Chat Completions, Responses, model list) |
| Anthropic base URL | https://api.popnow.ai (the SDK adds /v1/messages) |
| Gemini | POST https://api.popnow.ai/v1beta/models/{model}:generateContent |
| Key | Authorization: Bearer sk-popnow-…; the Anthropic SDK's x-api-key and Google's x-goog-api-key headers also work |
| Model IDs | publisher/model/chat, for example anthropic/claude-haiku-5.5/chat. The full list is below |
| Price | Per token, in USD, with no per-request minimum. Failed and refused requests are refunded |
| Streaming | stream: true on every protocol (:streamGenerateContent?alt=sse for Gemini) |
Your first chat request
curl https://api.popnow.ai/v1/chat/completions \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-haiku-5.5/chat",
"messages": [
{ "role": "system", "content": "You are a concise, friendly assistant." },
{ "role": "user", "content": "Suggest three names for a kite shop by the sea." }
],
"max_tokens": 512
}'The reply is a standard chat.completion object with choices[0].message.content and usage. The X-PopNow-Task-Id response header names the task that recorded the charge.
OpenAI SDK
Point the client at https://api.popnow.ai/v1 and pass your PopNow key. Nothing else changes.
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.popnow.ai/v1", api_key=os.environ["POPNOW_API_KEY"])
reply = client.chat.completions.create(
model="anthropic/claude-haiku-5.5/chat",
messages=[{"role": "user", "content": "Write a haiku about kites."}],
max_tokens=200,
)
print(reply.choices[0].message.content)import OpenAI from 'openai';
const client = new OpenAI({ baseURL: 'https://api.popnow.ai/v1', apiKey: process.env.POPNOW_API_KEY });
const reply = await client.chat.completions.create({
model: 'google/gemini-3.7-flash/chat',
messages: [{ role: 'user', content: 'Write a haiku about kites.' }],
max_tokens: 200,
});
console.log(reply.choices[0].message.content);The Responses API (client.responses.create) works too, in its stateless form: send the whole conversation in input each time. previous_response_id returns 400.
Anthropic SDK
The Anthropic SDK adds /v1/messages itself, so the base URL has no /v1.
import os
import anthropic
client = anthropic.Anthropic(base_url="https://api.popnow.ai", api_key=os.environ["POPNOW_API_KEY"])
message = client.messages.create(
model="anthropic/claude-sonnet-5.5/chat",
max_tokens=512,
messages=[{"role": "user", "content": "Explain idempotency keys in two sentences."}],
)
print(message.content[0].text)Any chat model works on this endpoint, not only Claude. Errors come back in Anthropic's {"type": "error", "error": {...}} shape.
Gemini generateContent
Put the full model ID in the path; it may contain slashes.
curl "https://api.popnow.ai/v1beta/models/google/gemini-3.7-flash/chat:generateContent" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{ "role": "user", "parts": [{ "text": "Name three colours of a sunset." }] }],
"generationConfig": { "maxOutputTokens": 256 }
}'Use :streamGenerateContent?alt=sse for a stream. Errors use Google's {"error": {"code", "message", "status"}} shape.
Streaming
Set stream: true and read Server-Sent Events. On Chat Completions every chunk is a chat.completion.chunk and the stream ends with data: [DONE]. As with OpenAI, a stream carries no usage unless you ask for it with stream_options: { "include_usage": true }; the usage then arrives in one last chunk with an empty choices array.
stream = client.chat.completions.create(
model="anthropic/claude-haiku-5.5/chat",
messages=[{"role": "user", "content": "Count from one to five."}],
max_tokens=100,
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")Tools, JSON output and parameters
Each model declares the request fields it accepts — tools, tool_choice, response_format, temperature, reasoning_effort and so on. The Parameters column in the model table lists them, and GET /v1/models returns them in supported_parameters.
- A sampling setting the model does not take (
temperature,top_p,frequency_penalty…) is dropped instead of failing, and named in theX-PopNow-Ignored-Paramsresponse header. - A value outside the model's range is moved to the nearest accepted value and reported in
X-PopNow-Adjusted-Paramsasname=value. - Any other field the model does not declare returns
400withcode: unsupported_parameterandparamnaming the field, for example an image part sent to a text-only model.
Models and prices
Use USD prices per 1 million tokens, input and output separately; cached input is cheaper on models that cache. Some models charge a higher rate once a request passes a long-context threshold, shown under the model name.
| Model | Model ID | Context | Input per 1M tokens (USD) | Output per 1M tokens (USD) | Parameters |
|---|---|---|---|---|---|
| Claude Fable 5Anthropic | anthropic/claude-fable-5/chat | 1MMax output 128K | $9cached $0.9cache write $11 | $45 | max_tokensparallel_tool_callsreasoning_effortstoptool_choicetools |
| Claude Haiku 5.5AnthropicInput > 100K tokens per request: $0.5 / $2.5 · cached $0.1 | anthropic/claude-haiku-5.5/chat | 1MMax output 128K | $0.1cache write $0.1 | $0.5 | max_tokensparallel_tool_callstool_choicetools |
| Claude Opus 4.5Anthropic | anthropic/claude-opus-4.5/chat | 198KMax output 33K | $4.5cached $0.45cache write $5.5 | $22.5 | max_tokensparallel_tool_callsreasoning_effortstoptemperaturetool_choicetoolstop_p |
| Claude Opus 4.6Anthropic | anthropic/claude-opus-4.6/chat | 1MMax output 128K | $5cached $0.5cache write $6.25 | $25 | max_tokensparallel_tool_callsreasoning_effortstoptemperaturetool_choicetoolstop_p |
| Claude Opus 5Anthropic | anthropic/claude-opus-5/chat | 1MMax output 128K | $4.5cached $0.45cache write $5.5 | $22.5 | max_tokensparallel_tool_callsreasoning_effortstoptool_choicetools |
| Claude Opus 5.5Anthropic | anthropic/claude-opus-5.5/chat | 1MMax output 128K | $3.6cached $0.18cache write $4.5 | $18 | max_tokensparallel_tool_callsreasoning_effortstoptool_choicetools |
| Claude Sonnet 4.5Anthropic | anthropic/claude-sonnet-4.5/chat | 198KMax output 64K | $2.7cached $0.27cache write $3.3 | $13.5 | max_tokensparallel_tool_callsstoptemperaturetool_choicetoolstop_ktop_p |
| Claude Sonnet 4.6Anthropic | anthropic/claude-sonnet-4.6/chat | 1MMax output 64K | $3cached $0.3cache write $3.75 | $15 | max_tokensparallel_tool_callsreasoning_effortstoptemperaturetool_choicetoolstop_ktop_p |
| Claude Sonnet 5Anthropic | anthropic/claude-sonnet-5/chat | 1MMax output 64K | $1.9cached $0.19cache write $2.375 | $9.5 | max_tokensparallel_tool_callsreasoning_effortstoptool_choicetools |
| Claude Sonnet 5.5Anthropic | anthropic/claude-sonnet-5.5/chat | 1MMax output 128K | $2cached $0.2cache write $2.5 | $10 | max_tokensparallel_tool_callsreasoning_effortstoptool_choicetools |
| DeepSeek V4.1 FlashDeepSeek | deepseek/v4.1-flash/chat | 1MMax output 384K | $0.3cached $0.006 | $1.2 | max_tokensreasoning_effortresponse_formatstoptool_choicetools |
| DeepSeek V4 FlashDeepSeek | deepseek/v4-flash/chat | 1MMax output 66K | $0.44cached $0.014 | $1.32 | max_tokensreasoning_effortresponse_formatstoptool_choicetools |
| DeepSeek V4 ProDeepSeek | deepseek/v4-pro/chat | 1MMax output 384K | $1.32cached $0.044 | $3.96 | max_tokensparallel_tool_callsreasoning_effortresponse_formatstoptool_choicetools |
| Gemini 2.5 FlashGoogle | google/gemini-2.5-flash/chat | 1MMax output 66K | $0.285cached $0.0285 | $2.375 | max_tokensreasoning_effortresponse_formatseedstoptemperaturetool_choicetoolstop_p |
| Gemini 3.1 Pro PreviewGoogleInput > 200K tokens per request: $3.8 / $17.1 · cached $0.38 | google/gemini-3.1-pro-preview/chat | 1MMax output 33K | $1.9cached $0.19 | $11.4 | max_tokensreasoning_effortresponse_formatseedstoptemperaturetool_choicetoolstop_p |
| Gemini 3.5 Flash-LiteGoogle | google/gemini-3.5-flash-lite/chat | 1MMax output 66K | $0.3cached $0.03 | $2.5 | max_tokensreasoning_effortresponse_formatseedstoptemperaturetool_choicetoolstop_p |
| Gemini 3.7 FlashGoogle | google/gemini-3.7-flash/chat | 1MMax output 66K | $0.675cached $0.0675 | $3.375 | max_tokensreasoning_effortresponse_formatseedstoptemperaturetool_choicetoolstop_p |
| Gemini 3 Flash PreviewGoogle | google/gemini-3-flash-preview/chat | 256KMax output 66K | $0.45cached $0.045 | $2.7 | max_tokensreasoning_effortresponse_formatseedstoptemperaturetool_choicetoolstop_p |
| GLM 5.2Z.ai | zai/glm-5.2/chat | 1MMax output 131K | $0.98cached $0.182 | $3.08 | max_tokensreasoning_effortresponse_formatstoptemperaturetool_choicetoolstop_p |
| GLM 5.3Z.ai | zai/glm-5.3/chat | 1MMax output 131K | $1.05cached $0.195 | $3.3 | max_tokensparallel_tool_callsreasoning_effortresponse_formatseedstoptemperaturetool_choicetoolstop_p |
| GLM 5.3 FlashZ.ai | zai/glm-5.3-flash/chat | 1MMax output 131K | $0.1275cached $0.0255 | $0.425 | max_tokensreasoning_effortresponse_formatstoptemperaturetool_choicetoolstop_p |
| Grok 4.3xAIInput ≥ 200K tokens per request: $2.5 / $5 · cached $0.4 | xai/grok-4.3/chat | 1MMax output 900K | $1.25cached $0.2 | $2.5 | max_tokensparallel_tool_callsreasoning_effortresponse_formattemperaturetool_choicetoolstop_p |
| Grok 4.5xAIInput ≥ 200K tokens per request: $4 / $12 · cached $0.6 | xai/grok-4.5/chat | 500KMax output 450K | $2cached $0.3 | $6 | max_tokensparallel_tool_callsreasoning_effortresponse_formattemperaturetool_choicetoolstop_p |
| Grok 4.6xAIInput ≥ 200K tokens per request: $4 / $12 · cached $1 | xai/grok-4.6/chat | 500KMax output 450K | $2cached $0.5 | $6 | max_tokensparallel_tool_callsreasoning_effortresponse_formattemperaturetool_choicetoolstop_p |
| Grok 4.7xAIInput ≥ 200K tokens per request: $4 / $12 · cached $1 | xai/grok-4.7/chat | 500KMax output 450K | $2cached $0.5 | $6 | max_tokensparallel_tool_callsreasoning_effortresponse_formattemperaturetool_choicetoolstop_p |
| Kimi K3Moonshot AI | moonshot/kimi-k3/chat | 1MMax output 1M | $2.7cached $0.3 | $13.5 | max_tokensreasoning_effortresponse_formatstoptool_choicetools |
The same list is available from the API, with prices, context length and supported parameters:
curl "https://api.popnow.ai/v1/models?modality=text" \
-H "Authorization: Bearer $POPNOW_API_KEY"How a chat request is charged
- Hold. When the request is accepted, the most it could cost is set aside from your balance, worked out from the input and
max_tokens. If you leavemax_tokensout, the model's maximum output is used, so set it to keep holds small. - Charge. When the reply ends you pay for the tokens actually used, in USD, with no per-request minimum. The rest of the hold is released.
- Refund. A request that fails, or that the model refuses, is refunded in full.
A balance smaller than the hold, or a key spend cap that would be passed, returns 402 before anything is sent to the model. To see the exact charge, read the task named in X-PopNow-Task-Id with GET /api/v1/jobs/recordInfo: costUsd is the USD decimal string to display and use for accounting. Legacy credit fields may also appear; do not round USD charges to whole credits.
Long replies and errors
- Long non-streaming calls. If a reply takes more than about 30 seconds, the
200status and anX-PopNow-Keepalive: 1header are sent first, then a newline every 15 seconds, then the JSON body. A failure after that point arrives as the protocol's usual error object inside the200body, so check for anerrorkey when that header is present. Streaming avoids this. 404model_not_found. The model ID does not exist. The error names the closest chat model you can call.400withparam: model. The ID belongs to an image, video or audio model; those run as tasks.400content_rejected. The model's own content policy refused the request. Nothing is charged.402. Not enough API USD for the hold, or a key spend limit. See API billing.
Privacy
Requests are sent to the model as you wrote them; PopNow adds no system prompt of its own. Each model's own usage policy applies. Message text is not kept after the charge settles.

