Guides
Cost guides, API how-tos, migration guides and an AI API glossary for building with GPT, Claude and Gemini on one key.
AI API questions
- How do I generate a transparent AI image with GPT Image?Create a real transparent PNG or WebP with GPT Image 2.5 Flare or Sunburst through TokenRex, then verify the alpha channel before using it.
- Should AI images be PNG, JPEG or WebP?Choose PNG, JPEG or WebP for AI-generated images by transparency, file size, editing workflow and the formats TokenRex exposes for each image model.
- How do I choose Gemini image resolution: 1K, 2K or 4K?Select 1K, 2K or 4K Gemini image output on TokenRex by model ID, set supported aspect ratios and compare live per-image prices.
- What is the cheapest LLM API for my workload?Find the cheapest LLM for your real input, output and cache mix with live TokenRex prices instead of choosing by input price alone.
- How should I compare cheap and premium LLMs before choosing one?Test cheap and premium LLMs on your own prompts, quality rubric and cost per accepted result before choosing a production model.
Cost guides
- How much does an AI chatbot cost per month?Monthly cost of a customer-support chatbot on GPT, Claude and Gemini, calculated from live API prices.
- How much does an AI coding agent cost?Estimated monthly cost of running a coding agent such as Cursor, Claude Code or Codex CLI on your own API key.
- How much does a RAG app cost to run?Cost of retrieval-augmented generation: answering questions over your documents with live model prices.
- Cost to summarise documents with an LLMWhat it costs to summarise reports, articles and transcripts with GPT, Claude and Gemini.
- Cost of AI translation with an LLM APIMonthly cost of translating text with large language models, from live per-token prices.
- Cost to classify emails and tickets with AIPrice of tagging, routing and classifying emails or support tickets with a small LLM.
- Cost of extracting structured data with an LLMMonthly cost of turning invoices, forms and web pages into JSON with an LLM.
- How much does an AI agent cost per task?Estimate the cost of multi-step AI agents that call tools, from live model prices.
- Cost of AI content writing with an APIWhat blog posts, product descriptions and marketing copy cost to generate with an LLM.
- Cost of long-context requests (100K+ tokens)Price of sending very long documents or code bases in a single request.
- Why reasoning models cost moreHow thinking tokens raise the cost of reasoning models, with live prices for low and high thinking variants.
- AI API budget for a startup MVPA realistic monthly AI API budget for an early product, with live prices across small and flagship models.
API how-to guides
- How to use the OpenAI SDK with a custom base URLPoint the official OpenAI Python or Node SDK at TokenRex to call GPT, Claude and Gemini models.
- How to call Claude with the OpenAI SDKUse Claude Opus, Sonnet and Haiku through the OpenAI SDK by changing only the model ID.
- How to call Gemini with the OpenAI SDKCall Gemini models through the OpenAI-compatible chat endpoint with one key.
- How to use the Anthropic Messages API on TokenRexSend Claude requests in Anthropic's native Messages format with the Anthropic SDK.
- How to stream LLM responsesShow AI replies word by word with streaming in Python and Node.
- How to use function calling (tools) with an LLM APILet the model call your own functions with the OpenAI tools format.
- How to send images to a vision modelAsk a chat model questions about an image by sending it in the message content.
- How to generate images with an APICreate images from text prompts with OpenAI and Google image models through one endpoint.
- How to convert text to speech with an APIGenerate spoken audio from text with a TTS model.
- How to transcribe audio with an APITurn recordings into text with a speech-to-text model.
- How to create embeddings for semantic searchTurn text into vectors for search and RAG with OpenAI or Google embedding models.
- How to check your API wallet balanceRead your remaining TokenRex wallet balance from code.
- How to list available models from the APIGet the current list of enabled model IDs programmatically.
- How to reduce LLM API costsPractical ways to cut your AI API bill without hurting quality.
Migration guides
- Migrate from the OpenAI API to TokenRexMove an existing OpenAI SDK app to TokenRex in two lines and gain Claude and Gemini models.
- Migrate from OpenRouter to TokenRexSwitch from OpenRouter to TokenRex with INR billing and UPI top-ups.
- Migrate from the Anthropic API to TokenRexKeep using the Anthropic SDK for Claude, or switch to the OpenAI format to reach every model.
- Migrate from the Google Gemini API to TokenRexMove Gemini calls to the OpenAI-compatible format on TokenRex.
- Migrate from LangChain's ChatOpenAI default endpoint to TokenRexPoint LangChain at TokenRex with one setting.
- Migrate from the Vercel AI SDK OpenAI provider to TokenRexUse TokenRex as an OpenAI-compatible provider in the Vercel AI SDK.
- Migrate from several separate provider accounts to TokenRexReplace separate OpenAI, Anthropic and Google keys with one key and one wallet.
- Migrate from USD card billing to TokenRexPay for AI APIs in rupees with UPI instead of an international card.
AI API glossary
- What is a token?A token is a small piece of text, often part of a word, that language models read and write. In English one token is about four characters.
- What is a context window?The context window is the maximum number of tokens a model can read in one request, including your prompt, the conversation and its reply.
- What is prompt caching?Prompt caching lets a provider reuse a repeated beginning of a prompt at a lower input price instead of reprocessing it.
- What is a unified LLM API?A unified LLM API gives you one endpoint and one key to call models from many providers.
- What is an AI gateway? LLM routing, proxies and marketplacesUnderstand AI gateways, LLM routing and model marketplaces. Compare TokenRex, OpenRouter, LiteLLM and Portkey by documented role, model selection and billing responsibility.
- What is an OpenAI-compatible API?An OpenAI-compatible API accepts the same request and response format as OpenAI, so the OpenAI SDKs and many tools work by changing the base URL.
- What is BYOK (bring your own key)?BYOK means a tool lets you enter your own API key instead of paying through the tool's subscription.
- What is a model ID?A model ID is the exact name you send in a request to choose a model.
- What is reasoning (thinking) tokens?Reasoning tokens are hidden tokens a model generates while thinking before it answers.
- What is an embedding?An embedding is a list of numbers that represents the meaning of text, so similar texts have similar vectors.
- What is RAG (retrieval-augmented generation)?RAG means finding relevant passages from your own documents and adding them to the prompt so the model answers from them.
- What is function calling?Function calling lets a model ask your code to run a named function with structured arguments.
- What is streaming?Streaming sends the model's reply in small pieces as it is generated instead of all at once.
- What is LLM latency?Latency is how long you wait for a reply; time to first token is how long until the first word appears.
- What is a rate limit?A rate limit caps how many requests or tokens you can send in a period. Exceeding it returns HTTP 429.
- What is a multimodal model?A multimodal model accepts or produces more than text, such as images, audio or video.