# Verify API key

> GET https://api.nabrah.ai/api/ext/test

Group: Authentication. Page: https://www.nabrah.ai/en/docs/api-reference/authentication/verify-api-key

Validate an API key and confirm which project it belongs to. Send your key in the X-API-Key header; on success the endpoint echoes back the key id, the owning user id, the project (workspace) id the key is scoped to, and when it was created. Use it as a connectivity/auth smoke test before calling any other endpoint.

## Authentication — start here

Every /api/ext endpoint authenticates the same way. This endpoint is the quickest way to confirm your setup works.

- **Get a key**: In the dashboard open the workspace, go to the Developers tab, and generate a Web API key. The full key (prefixed nb_) is shown once at creation — copy and store it securely. Generate an Embed key instead only for browser/front-end use. Fields: `X-API-Key`.
- **Send the key**: Pass it on every request as the header X-API-Key: nb_xxxxxxxxxxxxxxxxxxxx. There is no project_id parameter anywhere in this API — the key is bound to exactly one project/workspace, and that scope is derived from the key automatically. Fields: `X-API-Key`.
- **Interpret the result**: 200 with status "success" means the key is valid; the returned project_id tells you which workspace you are acting on. 401 means the key is missing or invalid.

Base URL: https://api.nabrah.ai/api — so the full URL for this call is https://api.nabrah.ai/api/ext/test

## Where to go next

Common first calls once your key is verified:

- **List voices**: GET /api/ext/tts/voices — the voice ids used for text-to-speech and for an agent’s voice.
- **List agents**: GET /api/ext/agent — the agents available in this project and their ids.
- **List tools**: GET /api/ext/tool — function-calling tools you can attach to agents.

## Authorization

- `X-API-Key` (string, header, required): your workspace API key.

## Response

### 200 Successful Response

Content type: `application/json`

## Request examples

### cURL

```bash
curl --request GET \
  --url 'https://api.nabrah.ai/api/ext/test' \
  --header 'X-API-Key: <your-api-key>'
```

### Python

```python
import requests

url = "https://api.nabrah.ai/api/ext/test"
headers = {"X-API-Key": "<your-api-key>"}

response = requests.get(url, headers=headers)
response.raise_for_status()
print(response.json())
```

### JavaScript

```javascript
const response = await fetch("https://api.nabrah.ai/api/ext/test", {
  method: "GET",
  headers: { "X-API-Key": "<your-api-key>" },
});

const data = await response.json();
console.log(data);
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.nabrah.ai/api/ext/test", nil)
	req.Header.Set("X-API-Key", "<your-api-key>")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```
