> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/developer/rest-api/authenticate-with-the-rest-api.md).

# Authenticate with the REST API

Most Roboflow API endpoints require an API key or OAuth access token. You can authenticate your request through the `api_key` parameter in the body and the query, via an authentication header, or with a query parameter.

For applications that authenticate on behalf of Roboflow users, see [Sign In With Roboflow (Getting Started)](/developer/authentication/sign-in-with-roboflow-getting-started.md). OAuth access tokens work with all of the authentication methods below.

### Authentication Header

We recommend you authenticate with the REST API by sending your API key as a bearer authentication header.

Here is an example of the header structure:

```
Authorization: Bearer abcdefghijklmnopqrstuvwxyz
```

### Body Parameter

You can send your API key as a parameter within a JSON request body of POST endpoints.

Here is an example of using an API key in the body of a request:

```json
{
    "api_key":"abcdefghijklmnopqrstuvwxyz"
}
```

### Query Parameter

You can also send your API key through a query parameter in the URL of your request.

We recommend against this method of authentication for production applications for security reasons. We instead recommend sending authentication headers.

Here is an example of an API key sent in a query parameter:

```
https://api.roboflow.com?api_key=abcdefghijklmnopqrstuvwxyz
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/developer/rest-api/authenticate-with-the-rest-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
