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

# Authentication

> Learn how to authenticate your requests to the Magnific API

## API Key Authentication

Magnific API uses API keys to authenticate requests. You need to include your API key in the header of every API request to access the Magnific resources.

Currently, private API keys are the only way to authenticate with the Magnific API. This means that only server-to-server calls can be made to the API

All API endpoints are authenticated using API keys and picked up from the specification file.

<div className="my-11">
  <Columns>
    <Card title="Magnific API" icon="leaf" href="https://storage.googleapis.com/fc-freepik-pro-rev1-eu-api-specs/magnific-api-v1-openapi.yaml">
      Download the OpenAPI specification file
    </Card>
  </Columns>
</div>

## Using the API Key

Include your API key in the `x-magnific-api-key` header of your HTTP requests:

```bash theme={null}
curl -H "x-magnific-api-key: YOUR_API_KEY" https://api.magnific.com/v1/resources
```

<CodeGroup>
  ```javascript JavaScript theme={null}
  const axios = require('axios');

  const response = await axios.get('https://api.magnific.com/v1/resources', {
    headers: {
      'x-magnific-api-key': 'YOUR_API_KEY'
    }
  });
  ```

  ```python Python theme={null}
  import requests

  headers = {
      'x-magnific-api-key': 'YOUR_API_KEY'
  }

  response = requests.get('https://api.magnific.com/v1/resources', headers=headers)
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'uri'

  uri = URI.parse('https://api.magnific.com/v1/resources')
  request = Net::HTTP::Get.new(uri)
  request['x-magnific-api-key'] = 'YOUR_API_KEY'

  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
    http.request(request)
  end
  ```
</CodeGroup>

## Rate limiting

Be aware that API requests are subject to [rate limiting](/ratelimits). The specific limits may vary based on your account type and agreement with Magnific. Always check the API response headers for rate limit information.
