# Authentication

At Blockchain.com, we prioritize the security and integrity of your interactions with our API. To facilitate this, we've implemented a two-tiered authentication system, tailored to different use cases.&#x20;

* [Public Authentication](#public-authentication)
* [Private Authentication](#private-authentication)

By understanding and implementing the correct authentication type for your requirements, you can ensure secure and optimized interactions with our services.

### Generating API Keys

See our [Integration Guide](/pay/getting-started/integration-options.md#generating-api-keys) for how to generate your API Keys.

### Public Authentication

Public authentication is primarily used for endpoints consumed directly in your clients' browsers. It's designed to allow for general access without compromising sensitive data or operations.

**Header Requirement:**

* `X-Public-API-Key`

**Usage:** If your application is fetching non-sensitive data or services, and it’s being consumed in a client-facing environment like a browser, public authentication is suitable. For backend operations, consider the private authentication strategy.

#### Example

```bash
curl \
  -H "X-Public-API-Key: <yourPublicApiKey>" \
  https://api.blockchain.info/partner-gateway/partner-api/v1/currencies
```

### Private Authentication

Private authentication is meant for environments where you can securely store and distribute private API keys. This authentication method is robust and caters to sensitive operations or data fetching, allowing for higher rate limits and enhanced security.

**Header Requirements:**

* `X-Public-API-Key`
* `X-Private-API-Key`

**Usage:** When you're dealing with sensitive operations, or when your backend systems consume the API endpoints, private authentication is recommended. It provides more security and can handle a higher request volume

{% hint style="warning" %}
Always handle your private API keys with the utmost security. Ensure they are never exposed publicly, and avoid using this authentication method in client-side applications.
{% endhint %}

#### Example

```bash
curl \
  -H "X-Public-API-Key: <yourPublicApiKey>" \
  -H "X-Private-API-Key: <yourPrivateApiKey>" \
  https://api.blockchain.info/partner-gateway/partner-api/v1/currencies
```


---

# Agent Instructions: 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.blockchain.com/pay/api/partner-api/authentication.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.
