# Authentication

When integrating with the bunq API, you can authenticate using either an **API key** or **OAuth**, depending on your use case. **API keys** provide a straightforward way to authenticate, making them ideal for server-to-server communication and automated scripts. They offer fast access but come with security risks if exposed, as they grant broad permissions. **OAuth**, on the other hand, is designed for third-party applications that need user-specific access. It allows fine-grained permissions and secure authentication without sharing credentials but requires a more complex authorization flow. Choose the method that best fits your needs:&#x20;

{% hint style="info" %}
OAuth is the obligatory authentication method for public projects whereas using API keys is allowed as long as only you have access to your application.
{% endhint %}

{% content-ref url="/pages/sY7NIUhQd0YOhIITR7nE" %}
[API Keys](/basics/authentication/api-keys.md)
{% endcontent-ref %}

{% content-ref url="/pages/nQpuM79hqrXIE9iNgCIm" %}
[OAuth](/basics/authentication/oauth.md)
{% endcontent-ref %}


---

# 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://doc.bunq.com/basics/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.
