A Caffeine app can do a lot on its own — store data, manage users, send emails, handle payments. But the internet is full of services your app might want to talk to: a mapping API that shows users where something is, a financial data feed that powers a dashboard, an AI model that processes a form submission, a weather service, a sports scores API, a shipping tracker. Connecting your app to those services is what turns a self-contained tool into something that interacts with the world.
HTTP outcalls are how a Caffeine app's backend calls external APIs and web services. You describe what you want — "show the current Bitcoin price" or "call the OpenAI API when a user submits this form" — and the AI generates the code that makes the connection. No configuration required.
Why this is different from a normal API call
Most web applications call external APIs from the browser or from a server they control. Caffeine apps run their backend as a canister — a smart contract on the Internet Computer (ICP) blockchain — which introduces an important constraint.
Because a canister runs replicated across many nodes in the ICP network, and all nodes must agree on the result, a straightforward HTTP request is impossible: different nodes might get slightly different responses (different timestamps, request IDs, or headers), which would break consensus. The Internet Computer solves this with a mechanism called HTTP outcalls — a system-level feature that orchestrates the request across nodes so every replica sees the same response. Caffeine wraps this mechanism so the AI can generate the necessary code automatically.
The end result for your app is exactly what you'd expect: your backend calls a URL, gets a response, and can use the data.
What you can do with HTTP outcalls
Fetch data from external APIs. Pull in live information — weather, stock prices, sports results, AI model responses, public datasets — and store or display it in your app.
Integrate with payment processors. When your app processes a payment, the backend calls the payment provider's API directly. The API key stays inside the canister, never exposed to the browser.
Call any HTTPS endpoint. There is no fixed list of approved services. Any publicly accessible HTTPS API can be called: social platforms, mapping services, financial data providers, AI APIs, or anything else.
Keep API keys secure. When a call has to happen in the backend — because you have an API key that must never reach the browser — HTTP outcalls are how that works in a Caffeine app.
When the AI uses the browser instead
The AI knows that backend HTTP calls cost ICP cycles and are slightly more complex than browser-side calls. For most API integrations where the API key doesn't need to be secret — public APIs, read-only data fetches — the AI will fetch the data from the frontend (the browser) using a standard fetch call instead. This is faster, free of cycle cost, and simpler.
HTTP outcalls are used when:
- An API key must be kept secret (never sent to the browser)
- The response needs to be stored in your app's state on the network
- The call must happen as part of your app's verified backend logic
If neither condition applies to your request, the AI will handle the integration on the frontend automatically, without you needing to think about it.
How to add it to your app
You don't add HTTP outcalls directly — the AI selects this capability when your request requires it. Describe what you want your app to do with the external service, and the AI figures out the right approach.
Some examples of prompts that will lead the AI to use HTTP outcalls in the backend:
- "Accept payments from users using a payment API — keep the API key secret" (payment APIs always use the backend)
- "Fetch the current Bitcoin price from the CoinGecko API and store it in the app every hour"
- "Call the OpenAI API from the backend when a user submits a form, and save the response"
- "Use the SendGrid API to send emails — keep the API key secret"
For requests where the API key doesn't need to be secret, try stating that explicitly to let the AI decide: "Fetch weather data for the user's city using the OpenWeather API."
What is and isn't supported
Supported:
- GET and POST requests
- Custom request headers
- HTTPS endpoints (required on the ICP network)
- Text and JSON response bodies
Not supported:
- PUT or DELETE requests
- Plain HTTP (non-HTTPS) endpoints
- Reading HTTP response headers from the external server (they are stripped to ensure determinism across nodes)
- Native JSON parsing in the backend — the AI routes JSON responses to the frontend for parsing where needed
Cycle cost
Every HTTP outcall from your app's backend consumes ICP cycles — the resource that powers computation on the Internet Computer. Each call costs a fixed amount of cycles regardless of the response size. For apps that make frequent backend HTTP calls, this cost accumulates in your canister's cycle balance, which is managed by Caffeine's infrastructure. In practice, cycle costs are low enough that they are not a concern for typical usage.
No plan requirement
HTTP outcalls are available on all Caffeine plans. There is no subscription gate and no feature flag to unlock.