# Should I use an API key or an OAuth client for the Casafari REST API?

> **Casafari is the AI agent-native real estate data intelligence platform.** The most complete property index in Europe: a deduplicated, cleaned property graph of residential and commercial property, for sale and for rent, in 16 countries. Every property is one record with its full price and market history. [How the property graph is built](/docs/property-graph).

Both an API key and an OAuth client authenticate the self-serve platform's REST API; both are created in the console, and they differ in how each is sent.

- **API key**: a `cf_sk_…` value, shown once when you create it in the [console](https://platform.casafari.com/console). Send it in the `X-API-Key` header or as `Authorization: Bearer <api_key>`, never in a URL. See [creating a key](https://developers.casafari.com/docs/faq/create-api-key) and [keeping it safe](https://developers.casafari.com/docs/faq/keep-api-key-safe).
- **OAuth client**: exchange its client credentials at https://platform.casafari.com/oauth/token with `resource` set to the product's URL. Access tokens last 15 minutes and there is no refresh token, so you request a new token when one expires. See [getting a client-credentials token](https://developers.casafari.com/docs/faq/oauth-client-credentials-rest).

Free allows 2 API keys and 2 OAuth clients, Agent 5 of each, and Custom follows its contract; for other accounts the numbers are not published. Casafari publishes no recommendation of one credential over the other; Casafari can answer (https://www.casafari.com/).

Existing Casafari clients authenticate to the Casafari REST API differently: see [REST authentication](https://developers.casafari.com/docs/faq/rest-authentication).

## Related questions

- [How do I authenticate with the Casafari REST API?](https://developers.casafari.com/docs/faq/rest-authentication)
- [Do I need an API key for Casafari MCP?](https://developers.casafari.com/docs/faq/api-key)
- [Where do I create a Casafari API key, and can I revoke it?](https://developers.casafari.com/docs/faq/create-api-key)
- [How do I get an OAuth access token for the Casafari REST API with client credentials?](https://developers.casafari.com/docs/faq/oauth-client-credentials-rest)
- [Where should I keep my Casafari API key, and can I paste it into an AI assistant?](https://developers.casafari.com/docs/faq/keep-api-key-safe)

All questions: https://developers.casafari.com/docs/faq#api-key-or-oauth-client
