Loading template…

Use Claude Code with a mainland-reachable API base URL

Point Claude Code at https://modelfold.ai/anthropic with a ModelFold API key as ANTHROPIC_AUTH_TOKEN; Claude Code appends /v1/messages itself, this page is not a VPN, and reachability from mainland China depends on the network.

Claude Code reads the base URL, credential and model from environment variables. Set all four model variables to IDs returned by the authenticated model list, including Haiku, or background tasks may request a name this API does not serve. Prices below are ModelFold public token rates for the linked catalog pages.

Official sources checked:

Price snapshot updated:

Related guides

Current public prices

Pay as you go with prepaid credits. 200 credits = US$1. Credit charges round up to two decimal places; this is not USD rounding. Failed generations are not charged; a temporary hold may be released after failure. Review the final quote before submitting. Token rates are per one million tokens, input / output; video prices are starting prices for the listed configuration.

ModelModelFold USDOfficial USDUnit / configuration
Claude Haiku 5.50.072 in / 0.36 out$0.1 / $0.5 (≤100,000 input tokens)per 1M tokens
Claude Sonnet 5.50.96 in / 4.80 out$2 / $10per 1M tokens
Claude Opus 5.51.92 in / 9.60 out$4 / $20per 1M tokens
Claude Haiku 4.50.33 in / 1.71 outNot independently verifiedper 1M tokens
Claude Sonnet 4.61.02 in / 5.13 outNot independently verifiedper 1M tokens
Claude Opus 4.82.40 in / 12.00 outNot independently verifiedper 1M tokens

API examples

curl https://modelfold.ai/v1/models -H "Authorization: Bearer $MODELFOLD_API_KEY"
export ANTHROPIC_BASE_URL=https://modelfold.ai/anthropic
export ANTHROPIC_AUTH_TOKEN=$MODELFOLD_API_KEY
export ANTHROPIC_MODEL=claude-sonnet-5-5
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5-5
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-5-5
curl https://modelfold.ai/anthropic/v1/models \
  -H "Authorization: Bearer $MODELFOLD_API_KEY"

Examples are illustrative and were not sent to a paid model. Install the OpenAI Python SDK separately. Video and image requests follow each model page for required parameters; video jobs are asynchronous.

/ai-agent/claude-code

Frequently asked questions

Direct answer

Point Claude Code at https://modelfold.ai/anthropic with a ModelFold API key as ANTHROPIC_AUTH_TOKEN; Claude Code appends /v1/messages itself, this page is not a VPN, and reachability from mainland China depends on the network.

Does this mean I do not need a VPN inside Claude Code?

You do not put a proxy address in Claude Code. Requests go to modelfold.ai. Whether a given mainland network can open that host is not guaranteed, and this product is not a VPN.

Can I skip the Haiku variable?

No. Background tasks may still request the Haiku tier. Set ANTHROPIC_MODEL and the Sonnet, Opus and Haiku variables to IDs from GET /anthropic/v1/models.

Do I also need a Claude subscription?

This route uses a ModelFold API key and prepaid credits. It does not use a Claude subscription token, and it does not include features that exist only inside a Claude subscription.

Is ModelFold always the cheapest?

No. Compare the same model, context, cache mode and input/output mix. Final quotes and actual usage determine the charge.

Are failed generations charged?

Failed generations are not charged. A temporary reservation is not a final charge; check account logs for settlement.

Where do I find the correct model ID?

Use GET /v1/models and the linked model documentation. A website page slug is not always the API model ID.

Comparison sources