> ## Documentation Index
> Fetch the complete documentation index at: https://www.anything.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# APIs & Integrations

> Connect your app to any external API by describing what you need. Use Saved Secrets for keys and backend functions to call third-party services.

Your app can connect to any external API. Describe what service you want to use and the agent creates a [backend function](/apps/backend) that calls it from the cloud.

<Tip>
  You can paste a link to the API's documentation and Anything will usually figure out the rest. You can also ask it to search for the API docs itself.
</Tip>

<div style={{position: 'relative', paddingBottom: '56.25%', height: 0}}>
  <iframe src="https://www.loom.com/embed/7bb0b0ada1664992a0941176c0cf2d2c?sid=beca7229-ca3e-4a97-a944-55b915e6fc54" title="External API Integration Demo" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen" allowFullScreen webkitallowfullscreen="true" mozallowfullscreen="true" style={{position: 'absolute', top: 0, left: 0, width: '100%', height: '100%'}} />
</div>

## How to connect an API

<Steps>
  <Step title="Describe what you need">
    Tell the agent what API you want to use and what it should do:

    ```
    I want to connect to a pet facts API to display random facts
    ```

    ```
    Add Google Maps to show nearby restaurants with directions
    ```

    If you have the API docs, share the link so the agent can read them:

    ```
    I want to use the Spotify API. Here's the documentation:
    https://developer.spotify.com/documentation/web-api

    Can you integrate this into my music app?
    ```
  </Step>

  <Step title="Add your API key">
    If the API requires authentication, store your key in **Project Settings** > **Saved Secrets**.

    1. Go to **Project Settings** > **Saved Secrets**
    2. Click **Add a new secret**
    3. Use the name the agent tells you (it needs to match exactly)
    4. Paste your API key

    <Note>
      Not all APIs require keys. Many public APIs work without credentials.
    </Note>

    <Warning>
      Always use Saved Secrets for API keys. Never paste them directly into chat.
    </Warning>
  </Step>

  <Step title="Test it">
    Preview your app and check that the API calls work. If something breaks, describe the error and the agent will fix it.
  </Step>
</Steps>

## Examples

```
Connect to the Exa API to search the web and display the top 5 results
```

```
Use the Google Maps API so users can see their location and find nearby places
```

```
Pull weather data from OpenWeatherMap and show a 5-day forecast
```

```
Connect to the HubSpot API to look up a company's deal history
```

## Troubleshooting

If your API integration isn't working:

1. Check that your API key is correct and active in **Saved Secrets**
2. Make sure you haven't exceeded the API's rate limits
3. Verify you're using the right endpoints (share the API docs with the agent if needed)
4. Describe the error to the agent and it will help fix it

***

<CardGroup cols={2}>
  <Card title="Backend" icon="server" href="/apps/backend">
    Functions and API routes
  </Card>

  <Card title="Integrations" icon="puzzle-piece" href="/apps/integrations">
    Built-in service guides
  </Card>
</CardGroup>
