59API

← 返回教程列表

No US Credit Card? Your Claude API Quick Start

入门教程 · EN · 2026-10-22

Start here: you need API access, not a Claude subscription

Want to build with Claude but do not have a US credit card? First, separate two products: the Claude chat subscription and developer API access. Paying for one does not automatically fund the other. For scripts, applications, and coding agents, you need an API account, a supported payment route, and an API key.

This guide covers a direct-access check and a practical alternative: 59API, a pay-as-you-go AI API relay with a base URL of https://api.59api.com.

1. Check whether you actually need an alternative

A US-issued card is not a universal requirement for Claude. Direct access depends on Anthropic's supported locations, payment requirements, and your card issuer. Check the current official requirements before assuming your international card will fail.

If direct billing works, compare it with a relay on price and convenience. If it does not, a relay may offer a different payment route. However, a different billing provider does not override geographic restrictions, provider terms, or local law.

2. Verify payment support before depositing money

59API provides low-cost access to Claude and GPT models through one account. The crucial question is whether its checkout supports a payment method you can actually use.

If its payment options fit your situation, sign up at 59api.com and test with the smallest practical balance.

3. Create a key and choose an exact model

After funding your account, create an API key in the dashboard and save it in a local environment variable or secret manager. Never commit it to Git or expose it in browser-side JavaScript.

Copy the exact Claude model identifier from 59API's current model list. Sonnet is a sensible starting point for general development; Haiku suits lighter workloads, while Opus is worth evaluating for demanding tasks. Availability, versions, and aliases can change, so avoid guessing a model name.

59API describes its service as using native, official-quality models without downgrading. Treat that as a provider claim: test representative prompts and verify the selected model and billing records before moving production traffic.

4. Make one small request with the OpenAI SDK

59API offers OpenAI-compatible access, letting you reuse familiar tooling rather than rewrite your application.

With those environment variables set, run this Python one-liner:

python -c "import os; from openai import OpenAI; c=OpenAI(); r=c.chat.completions.create(model=os.environ['CLAUDE_MODEL'], messages=[{'role':'user','content':'Reply with OK.'}], max_tokens=16); print(r.choices[0].message.content)"

Confirm both the response and the dashboard charge. If it fails, check the endpoint, model identifier, authentication, and balance before retrying.

5. Connect Claude Code or Codex separately

59API supports Claude Code and Codex, but each client needs its own configuration. For Claude Code, follow 59API's current instructions for the Anthropic-compatible endpoint and authentication variables. Do not assume the OpenAI-compatible URL belongs in that configuration.

For Codex, use the documented custom-provider settings, including the required API format. Test a small task before enabling long sessions, repository-wide edits, or automatic retries.

6. Keep the cheap option cheap

59API positions itself among the cheapest relays, but compare current input, output, and caching rates for your exact model. Pay-as-you-go billing helps avoid a recurring subscription; it does not prevent expensive agent loops.

Use output limits, inspect usage, and check whether spending controls are available. Review the relay's privacy and retention policies before sending proprietary code. Its referral rebate may reduce costs further, but verify eligibility and payout terms rather than counting it as guaranteed savings.

价格 · 接入文档

准备好开始了吗?

几分钟接入 Claude 与 GPT,全网超低价,原生不降智。立即注册即可领取 API 密钥。

免费注册