SSmoFeng API
Anthropic-compatible · balance metered

One base URL. Every Anthropic client.

SmoFeng API is a drop-in endpoint for Claude Code, OpenCode, and any Anthropic-compatible tool. Authenticate with an issued key, and every request is billed against a USD balance you control.

Drop-in compatible

Standard Anthropic Messages requests work unchanged — point your client at this base URL and go.

Streaming support

Server-sent events mirror Anthropic's message_start / content_block_delta / message_stop lifecycle.

Pay by balance

Each key carries a USD balance metered by real token usage. Requests stop when the balance runs out.

Managed keys

Issue, top up, disable, or revoke per-user keys from the admin panel. Bulk-import your token pool from a .txt file.

Quickstart

Choose your client below. Set the base URL to this deployment and use your issued API key (starts with sk-ant-).

shell
# Point Claude Code at this endpoint
export ANTHROPIC_BASE_URL="https://your-deployment.vercel.app"
export ANTHROPIC_API_KEY="sk-ant-your-issued-key"

# Then run Claude Code as usual
claude

Models & pricing

Usage is metered per token and deducted from each key's balance. Rates are shown in USD per 1M tokens.

ModelInput / 1MOutput / 1M

Haiku

Fast, lightweight

$1.00$5.00

Sonnet

Balanced default

$3.00$15.00

Opus 4.8

Most capable

$5.00$25.00

Any Anthropic-style model ID containing haiku, sonnet, or opus resolves to the matching tier.

Endpoints

POST/v1/messages

Create a message. Supports streaming (SSE) and non-streaming responses.

POST/v1/messages/count_tokens

Estimate the token count for a request without generating a reply.

GET/v1/models

List the available models.

Authentication

Every request must include an API key issued from the admin panel. Send it via the x-api-key header or as a Bearer token. Each key carries a USD balance; once it is exhausted, requests are rejected with a 402 until the balance is topped up.