What Connecting to an External API Means
Your Replit app can call any service that has an API -- which is most modern software tools. Email services like Kit.com and Mailgun have APIs for sending emails and adding subscribers. Payment processors like Stripe have APIs for creating checkouts. AI services like Anthropic have APIs for generating text. Search tools like Exa.ai have APIs for semantic search.
Connecting to an API means your app can use these services without the user leaving your app. You call the API, get a response, and use it in your app's logic.
The pattern is always the same: get an API key, store it in Replit Secrets, tell Claude what you want to call and what to do with the response, paste the code. The specific service changes but the pattern never does.
How to Tell Claude What API to Call
"I want to connect my Replit app to [service name]. When [trigger], I want to call their API to [action]. My API key is stored in process.env.[KEY_NAME]. Here is a link to their API documentation: [URL]."
The documentation link is the most helpful addition -- Claude can read the specific endpoint format, required parameters, and authentication method from the docs, which produces more accurate code than working from memory.
Storing API Keys Safely
Every API key goes in Replit Secrets -- never directly in your code. Code is visible to anyone who views your Replit. Secrets are encrypted and only accessible to your running app via process.env. This is the most important security practice for any Replit app.