---
updatedAt: 2025-11-11T01:52:49.000Z
agentTools:
  projectIndex: https://docs.formant.io/llms.txt
---

# Use the Formant agent to authenticate API calls

API endpoints with an authorized user of `device` can authenticate calls using the agent. This is accomplished using the `call_cloud()` method of the Agent SDK.

<Image alt="A Formant API endpoint with `device` as an authorized role." align="center" src="https://files.readme.io/09ade54-Screenshot_2023-07-27_at_4.41.48_PM.png">
  A Formant API endpoint with `device` as an authorized role.
</Image>

# Step 1: Choose an API method which allows `device` as an authorized role

Review the list of API endpoints in [our API reference](https://docs.formant.io/reference/accountcontrollerpost). Methods with `device` as an authorized role can use the Formant agent for authentication.

# Step 2: Use the `call_cloud()` method

Use the Agent SDK's `call_cloud()` method to call the API method. You can set the `require_formant_auth` parameter to enforce authorization or use the Formant agent as the source of authentication.

> 📘
>
> See the [Agent SDK reference](https://docs.formant.io/reference/agent-sdk-reference) for full syntax and parameters of the `call_cloud()` method.

> 📘
>
> You can find an example on our GitHub page: [GitHub: `post_device_authenticated_cloud_call.py`](https://github.com/FormantIO/formant/blob/master/examples/python/formant_module/agent/post_device_authenticated_cloud_call.py).

> 🚧
>
> If you're having trouble authenticating with the agent, try [updating your agent](https://docs.formant.io/docs/update-the-agent) and [your Python SDK](https://stackoverflow.com/questions/5183672/how-do-i-update-a-python-package).

<Callout icon="👋" theme="default">
  ### If you notice an issue with this page or need help, please reach out to us! Use the 'Did this page help you?' buttons below, or get in contact with our Customer Success team via the Intercom messenger in the bottom-right corner of this page, or at [support@formant.io](mailto:support@formant.io).
</Callout>