Claude Code pricing

Claude Code is the CLI agent; you can drive it with a subscription or with a token-billed API key. Point ANTHROPIC_BASE_URL at Code By AI and the same CLI bills per token from 1/6 of list price.

List price

$60.00

/ month, claude-sonnet-5

Code By AI

$8.00

/ month, same workload

Saving

87%

20M input / 2M output

Three lines to switch

Set the base URL and token, then run claude as usual. The model IDs below are the ones this endpoint accepts.

export ANTHROPIC_BASE_URL="https://www.codebyai.net/api/agent"
export ANTHROPIC_AUTH_TOKEN="sk-proj-xxxx" # replace with your Code By AI key
claude

Claude models on Code By AI

ModelList priceYou pay
claude-haiku-4-5-20251001$1.00 / $5.00$0.13 / $0.67
claude-sonnet-5Default$2.00 / $10.00$0.27 / $1.33
claude-sonnet-5-5$2.00 / $10.00$0.27 / $1.33
claude-sonnet-4-6$3.00 / $15.00$0.40 / $2.00
claude-opus-5-5$4.00 / $20.00$0.53 / $2.67
claude-opus-4-6$5.00 / $25.00$0.67 / $3.33
claude-opus-4-7$5.00 / $25.00$0.67 / $3.33
claude-opus-4-8$5.00 / $25.00$0.67 / $3.33
claude-opus-5$5.00 / $25.00$0.67 / $3.33
claude-fable-5$10.00 / $50.00$2.00 / $10.00
claude-fable-5-1$10.00 / $50.00$2.00 / $10.00

per 1M tokens (input / output)

FAQ

Does Claude Code work with a Code By AI key?
Yes. Set ANTHROPIC_BASE_URL to https://www.codebyai.net/api/agent and use any Code By AI key as ANTHROPIC_AUTH_TOKEN; the CLI keeps working as before.
Is per-token billing cheaper than a Claude subscription?
On claude-sonnet-5, 20M input and 2M output tokens per month is $60.00 at list price and $8.00 through Code By AI. A flat subscription can win if your usage is steady and heavy; per-token wins when it is uneven.