OpenAI Compatible

Anthropic Messages API on a PopNow text model

Accepts an Anthropic Messages request (model, system, messages with text / image / tool_use / tool_result blocks, max_tokens, temperature, top_p, top_k, stop_sequences, tools, tool_choice, stream) and translates it to a chat completion internally. stop_sequences becomes the model's stop field, and tool_choice.disable_parallel_tool_use: true becomes parallel_tool_calls: false; a model that does not declare the target field rejects the request with 400 instead of ignoring it. Non-streaming calls return an Anthropic message object. Streaming calls emit message_start, content_block_start, content_block_delta, content_block_stop, message_delta and message_stop events. Errors use the Anthropic {type:"error",error:{type,message}} shape.

Billing: chat models are priced per token in credits (1 credit = $0.001), listed per 1M input and output tokens in credits on GET /api/v1/models and GET /v1/models. When the request is accepted, the most it can cost is held from your balance, computed from the input and max_tokens (the model's maximum output when you omit it, so set max_tokens to keep holds small). When the reply ends you are charged its actual usage in fractional credits, with no per-request minimum, and the rest of the hold is released. A balance below the hold, or a key spend limit that would be exceeded, returns 402 before anything is sent to the model. A request that fails or that the model refuses is refunded in full. The X-PopNow-Task-Id response header names the task; GET /api/v1/jobs/recordInfo shows the final charge in cost (USD) and exactCredits. Message text is not kept after the charge settles. Requests are forwarded to the model as sent and each model's own usage policy applies.

post/v1/messages

Request

  • Base URL: https://api.popnow.ai
  • URL: https://api.popnow.ai/v1/messages
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Stable key for one logical task submission; retained for 24 hours per account and bound to both the submitting API key and normalized request fingerprint. A sibling key receives 409 without the original task ID.

Request body

modelstring required
max_tokensinteger required
temperaturenumber
top_pnumber
top_kinteger
stop_sequencesstring[]
toolsobject[]
tool_choiceobject

disable_parallel_tool_use: true is translated to parallel_tool_calls: false.

streamboolean

Response

One Anthropic message object, or an SSE stream when stream is true.

idstring required
type'message' required
role'assistant' required
modelstring required
stop_reason'end_turn' | 'max_tokens' | 'tool_use' required
stop_sequenceunknown

Changes

No recorded changes to this operation across all 1 revision of this API.