Skip to content

AI runtime and gateways

How do you add one AI feature to your app?

Choose one result you can check, such as a workshop title. Decide which fields the model needs, estimate the cost per draft, and let people finish the task if the model cannot help.

What is the smallest job to give a model?

Start with a draft a person can check, such as suggesting a title and category for a workshop. The app already knows the time, price and location. Keep those facts as the source of truth.

A model is what generates the draft. An API is the connection your app uses to send a request. A gateway can put a common connection in front of several providers. Decide whether you need that extra layer after you know the first job and how it can fail.

What can make a model call cost more?

Count the text you send, the text you receive and any separate features you enable. Pricing commonly lists input and output separately per million tokens, which are small pieces of text.

One person pressing “Draft again” three times can generate three calls. Estimate with an expected answer length and count retries. Also check how many calls can run in a busy minute, since a rate limit can stop requests before a monthly budget is reached.

Compare tools

Scroll the table sideways to read every column.

Compare direct model APIs and an app library for a first feature.
ToolWhat you connectThe service your app calls.What can change the billModel usage and separately priced features.What can stop a requestTraffic limits and spend controls to check.What to check before sending dataTraining, retention and service scope.
OpenAI APICall an OpenAI model from your app. ChatGPT is a separate product.Check model rates for input, cached input and output, plus any separately priced features.Request and token limits are separate from budget and spend controls.API training is opt-in. Check endpoint retention and feature settings.
AnthropicUse the Claude API to request output from a Claude model.Compare model input and output rates, plus any cache or tool charges.Direct API has rate limits and monthly spend limits. Confirm the active tier.Commercial data is excluded from training by default. Check standard retention and feature exceptions.
Vercel AI SDKAdd a TypeScript library and select a direct provider or gateway connection.The SDK is open source. Model usage is billed separately by the service you configure.Check limits on the selected service and model. Feature support differs.Check which provider receives the request and whether a gateway is also involved.
OpenRouterCall one gateway address for compatible models from several providers.Check model usage, the credit arrangement and charges for any extra service.Model availability, account limits or privacy rules can leave no eligible route.OpenRouter request logs and the chosen provider’s retention are separate. Check both.
CloudflareRoute calls through Cloudflare AI Gateway to the model service you choose.Core gateway features can be free. Check model charges and the account’s log and export pricing.Check your configured request limit and the model service’s own capacity.Review whether logs keep request or reply contents, and check the model service separately.
LiteLLMOperate a gateway that connects your app to configured model services.Model providers, hosting and the database are separate costs. Some features depend on edition.Budget enforcement needs a connected database and the intended scope.Review usage logs, optional content storage and provider handling.
Vercel AI GatewayCall a hosted gateway for supported models. The AI SDK is separate.Check free-tier eligible models, paid credits, direct provider billing and add-ons.Model limits, depleted credits or restricted routes can block a request.Check the eligible routes, retention settings and app logs.
GroqUse GroqCloud to run a model directly.Check model-specific input/output or time units.Organization limits can count requests, tokens or audio.Check data controls, usage metadata and retention exceptions for the selected feature.
ReplicateSend a prediction to a hosted model and handle its job result.Pricing can count hardware time, input or output depending on model and deployment.Job state and model limits determine whether a result is ready.API prediction data has a default cleanup window. Keep approved copies of needed outputs.
Together AIChoose hosted shared model access or a separate dedicated deployment.Compare token-based usage with time-based capacity and plan terms.Check the chosen model, plan and throughput before assuming availability.Check account settings and the retention scope of the feature you use.

What should you check before sending real information?

Identify which service receives each field, what it can keep and whether it may use the content to improve models. Check the exact service tier, feature and region. Keep the secret credential and the decision about what to send on your server.

For a public class heading, the class topic might be enough. An attendee list or private note has no role in that draft. A gateway adds another service whose data practices you need to check.

How can you compare the result without opening an account?

Sketch a fictional pottery workshop and three pretend replies. Use no model, keys or real records.

  1. Accept the supported draft
    Let the reply keep the pottery topic and choose a category from your approved list.
  2. Reject the invented detail
    Give the next reply a price that was absent from the input. The app should discard the draft or ask a person to correct it.
  3. Keep a manual path
    Treat the last call as unavailable. Let the person write a title and choose a category without waiting for the model.