PopNowAPI Docs
Chat and compatible APIs
Main content

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 URLhttps://api.popnow.ai/v1 (Chat Completions, Responses, model list)
Anthropic base URLhttps://api.popnow.ai (the SDK adds /v1/messages)
GeminiPOST https://api.popnow.ai/v1beta/models/{model}:generateContent
KeyAuthorization: Bearer sk-popnow-…; the Anthropic SDK's x-api-key and Google's x-goog-api-key headers also work
Model IDspublisher/model/chat, for example anthropic/claude-haiku-5.5/chat. The full list is below
PricePer token, in USD, with no per-request minimum. Failed and refused requests are refunded
Streamingstream: 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.

Python
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)
JavaScript (Node.js 18+)
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.

Python
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.

Python
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 the X-PopNow-Ignored-Params response header.
  • A value outside the model's range is moved to the nearest accepted value and reported in X-PopNow-Adjusted-Params as name=value.
  • Any other field the model does not declare returns 400 with code: unsupported_parameter and param naming 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.

ModelModel IDContextInput per 1M tokens (USD)Output per 1M tokens (USD)Parameters
Claude Fable 5Anthropicanthropic/claude-fable-5/chat1MMax output 128K$9cached $0.9cache write $11$45max_tokensparallel_tool_callsreasoning_effortstoptool_choicetools
Claude Haiku 5.5AnthropicInput > 100K tokens per request: $0.5 / $2.5 · cached $0.1anthropic/claude-haiku-5.5/chat1MMax output 128K$0.1cache write $0.1$0.5max_tokensparallel_tool_callstool_choicetools
Claude Opus 4.5Anthropicanthropic/claude-opus-4.5/chat198KMax output 33K$4.5cached $0.45cache write $5.5$22.5max_tokensparallel_tool_callsreasoning_effortstoptemperaturetool_choicetoolstop_p
Claude Opus 4.6Anthropicanthropic/claude-opus-4.6/chat1MMax output 128K$5cached $0.5cache write $6.25$25max_tokensparallel_tool_callsreasoning_effortstoptemperaturetool_choicetoolstop_p
Claude Opus 5Anthropicanthropic/claude-opus-5/chat1MMax output 128K$4.5cached $0.45cache write $5.5$22.5max_tokensparallel_tool_callsreasoning_effortstoptool_choicetools
Claude Opus 5.5Anthropicanthropic/claude-opus-5.5/chat1MMax output 128K$3.6cached $0.18cache write $4.5$18max_tokensparallel_tool_callsreasoning_effortstoptool_choicetools
Claude Sonnet 4.5Anthropicanthropic/claude-sonnet-4.5/chat198KMax output 64K$2.7cached $0.27cache write $3.3$13.5max_tokensparallel_tool_callsstoptemperaturetool_choicetoolstop_ktop_p
Claude Sonnet 4.6Anthropicanthropic/claude-sonnet-4.6/chat1MMax output 64K$3cached $0.3cache write $3.75$15max_tokensparallel_tool_callsreasoning_effortstoptemperaturetool_choicetoolstop_ktop_p
Claude Sonnet 5Anthropicanthropic/claude-sonnet-5/chat1MMax output 64K$1.9cached $0.19cache write $2.375$9.5max_tokensparallel_tool_callsreasoning_effortstoptool_choicetools
Claude Sonnet 5.5Anthropicanthropic/claude-sonnet-5.5/chat1MMax output 128K$2cached $0.2cache write $2.5$10max_tokensparallel_tool_callsreasoning_effortstoptool_choicetools
DeepSeek V4.1 FlashDeepSeekdeepseek/v4.1-flash/chat1MMax output 384K$0.3cached $0.006$1.2max_tokensreasoning_effortresponse_formatstoptool_choicetools
DeepSeek V4 FlashDeepSeekdeepseek/v4-flash/chat1MMax output 66K$0.44cached $0.014$1.32max_tokensreasoning_effortresponse_formatstoptool_choicetools
DeepSeek V4 ProDeepSeekdeepseek/v4-pro/chat1MMax output 384K$1.32cached $0.044$3.96max_tokensparallel_tool_callsreasoning_effortresponse_formatstoptool_choicetools
Gemini 2.5 FlashGooglegoogle/gemini-2.5-flash/chat1MMax output 66K$0.285cached $0.0285$2.375max_tokensreasoning_effortresponse_formatseedstoptemperaturetool_choicetoolstop_p
Gemini 3.1 Pro PreviewGoogleInput > 200K tokens per request: $3.8 / $17.1 · cached $0.38google/gemini-3.1-pro-preview/chat1MMax output 33K$1.9cached $0.19$11.4max_tokensreasoning_effortresponse_formatseedstoptemperaturetool_choicetoolstop_p
Gemini 3.5 Flash-LiteGooglegoogle/gemini-3.5-flash-lite/chat1MMax output 66K$0.3cached $0.03$2.5max_tokensreasoning_effortresponse_formatseedstoptemperaturetool_choicetoolstop_p
Gemini 3.7 FlashGooglegoogle/gemini-3.7-flash/chat1MMax output 66K$0.675cached $0.0675$3.375max_tokensreasoning_effortresponse_formatseedstoptemperaturetool_choicetoolstop_p
Gemini 3 Flash PreviewGooglegoogle/gemini-3-flash-preview/chat256KMax output 66K$0.45cached $0.045$2.7max_tokensreasoning_effortresponse_formatseedstoptemperaturetool_choicetoolstop_p
GLM 5.2Z.aizai/glm-5.2/chat1MMax output 131K$0.98cached $0.182$3.08max_tokensreasoning_effortresponse_formatstoptemperaturetool_choicetoolstop_p
GLM 5.3Z.aizai/glm-5.3/chat1MMax output 131K$1.05cached $0.195$3.3max_tokensparallel_tool_callsreasoning_effortresponse_formatseedstoptemperaturetool_choicetoolstop_p
GLM 5.3 FlashZ.aizai/glm-5.3-flash/chat1MMax output 131K$0.1275cached $0.0255$0.425max_tokensreasoning_effortresponse_formatstoptemperaturetool_choicetoolstop_p
Grok 4.3xAIInput ≥ 200K tokens per request: $2.5 / $5 · cached $0.4xai/grok-4.3/chat1MMax output 900K$1.25cached $0.2$2.5max_tokensparallel_tool_callsreasoning_effortresponse_formattemperaturetool_choicetoolstop_p
Grok 4.5xAIInput ≥ 200K tokens per request: $4 / $12 · cached $0.6xai/grok-4.5/chat500KMax output 450K$2cached $0.3$6max_tokensparallel_tool_callsreasoning_effortresponse_formattemperaturetool_choicetoolstop_p
Grok 4.6xAIInput ≥ 200K tokens per request: $4 / $12 · cached $1xai/grok-4.6/chat500KMax output 450K$2cached $0.5$6max_tokensparallel_tool_callsreasoning_effortresponse_formattemperaturetool_choicetoolstop_p
Grok 4.7xAIInput ≥ 200K tokens per request: $4 / $12 · cached $1xai/grok-4.7/chat500KMax output 450K$2cached $0.5$6max_tokensparallel_tool_callsreasoning_effortresponse_formattemperaturetool_choicetoolstop_p
Kimi K3Moonshot AImoonshot/kimi-k3/chat1MMax output 1M$2.7cached $0.3$13.5max_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

  1. 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 leave max_tokens out, the model's maximum output is used, so set it to keep holds small.
  2. 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.
  3. 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 200 status and an X-PopNow-Keepalive: 1 header 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 the 200 body, so check for an error key when that header is present. Streaming avoids this.
  • 404 model_not_found. The model ID does not exist. The error names the closest chat model you can call.
  • 400 with param: model. The ID belongs to an image, video or audio model; those run as tasks.
  • 400 content_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.

On this page