Estimate API cost from input and output token counts and unit price, to budget a LLM feature before launch.
汇率按 1 USD ≈ 7.2 CNY 估算。
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Cost formula | total cost is input tokens times input price plus output tokens times output price | OpenAI API pricing reference |
| Input output price gap | output tokens usually cost more than input tokens so long answers scale cost faster | OpenAI API pricing reference |
| Billing unit | prices are quoted per million tokens and must be converted to a common currency and scale | ISO 4217 currency codes |