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

> ## Agent Instructions
> Every page is listed in https://docs.keenable.ai/llms.txt. To pick a product for a job, read https://docs.keenable.ai/choose.md
> Setup steps for agents, covering the SDKs, the MCP server and the CLI: https://docs.keenable.ai/skill.md
> Keenable search and fetch work without an API key. To add them to code, use the official SDK for the project's language: https://docs.keenable.ai/sdks.md
> Without a key, call POST https://api.keenable.ai/v1/search/public or GET https://api.keenable.ai/v1/fetch/public with an X-Keenable-Title header that names your app.
> With a key, send it in the X-API-Key header and read it from the KEENABLE_API_KEY environment variable. Never ask a user to paste a key into chat. Every access method: https://docs.keenable.ai/auth.md
> To get an API key without the console, use device login: https://docs.keenable.ai/authentication.md#device-login
> MCP server: https://api.keenable.ai/mcp (no key, or X-API-Key; keyless Codex uses https://api.keenable.ai/mcp-public), or https://api.keenable.ai/mcp-oauth for OAuth sign-in. These docs are an MCP server at https://docs.keenable.ai/mcp and the OpenAPI spec is at https://docs.keenable.ai/api-reference/openapi.json
> Keenable searches and fetches public web pages. If a question needs no web information, skip the call.
> On 402 with an API key (code insufficient_credits), stop and ask a human to add credits; don't retry. On 429, wait the number of seconds in Retry-After, then retry. Before you ship, follow https://docs.keenable.ai/production.md
> Every error, with its cause and fix, is in https://docs.keenable.ai/errors.md and moving from another search API is covered in https://docs.keenable.ai/migrate.md
> Before you compare Keenable with another search API, read https://docs.keenable.ai/guides/evaluate-search-apis.md

# Get API key identity

> Check that an API key works with GET /v1/auth/user, and see the user who created it and the organization it belongs to. Free.

Check that an API key works, and see which organization its calls draw on. The response names the user who created the key and the organization the key belongs to.

## When to use it

Call it once at startup, before your first search or fetch, to catch a mistyped or revoked key early. The call is free. It counts toward your organization's [rate limit](https://docs.keenable.ai/rate-limits.md) like any keyed call.

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
curl "https://api.keenable.ai/v1/auth/user" \
  -H "X-API-Key: $KEENABLE_API_KEY"
```

A `200` means the key works. The response looks like this:

```json Example response · IDs left out theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
{
  "user_id": "...",
  "email": "dev@example.com",
  "display_name": "Ada Lovelace",
  "org_id": "...",
  "org_name": "Example Inc"
}
```

`email`, `display_name` and `org_name` are `null` when Keenable has no value for them. A `401` means the key is missing, malformed or unknown, and a `403` means it was revoked. See [Authentication → Error responses](https://docs.keenable.ai/authentication.md#error-responses).

This endpoint takes an API key only. A signed-in session token returns `401` with `api_key_required`. It has no keyless or pay-per-request path.

## SDK, CLI and MCP

| Client | Call |
| - | - |
| Python, TypeScript, Go, Rust | No method. Call the API. |
| CLI | No command. `keenable login --api-key` calls it to check a key before saving it, and `keenable configure-mcp` to check the saved key. |
| MCP | No tool. |

## Related operations

* [API keys](https://docs.keenable.ai/api-keys.md) explains how to create and rotate a key.
* [Authentication](https://docs.keenable.ai/authentication.md) covers the `X-API-Key` and `Authorization: Bearer` headers.


## OpenAPI

````yaml GET /v1/auth/user
openapi: 3.0.3
info:
  title: Keenable API
  version: 1.0.0
  description: Web search, page fetching and monitors API.
servers:
  - url: https://api.keenable.ai
    description: Production
security:
  - apiKey: []
  - bearerAuth: []
paths:
  /v1/auth/user:
    get:
      tags:
        - Auth
      summary: Get API key identity
      description: >-
        Returns the user who created the API key and the organization it belongs
        to. Use it to check that a key works. The call is free. It needs an API
        key: a signed-in session token isn't accepted.
      operationId: auth_user
      responses:
        '200':
          description: The key's user and organization
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyIdentity'
        '401':
          description: >-
            No key was sent (`Missing API key`, code `missing_api_key`), a
            session token was sent instead of a key (`api_key_required`), or the
            key is malformed or unknown (`Authentication failed`, code
            `invalid_api_key`). Send a valid key in `X-API-Key` or
            `Authorization: Bearer`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: >-
            The key is revoked (`Forbidden`, `Key revoked`, code
            `credentials_forbidden`). Create a new key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/AuthUnavailable'
components:
  headers:
    XRequestId:
      description: ID of this request. Include it when you report a problem.
      schema:
        type: string
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
      example: 1
  schemas:
    ApiKeyIdentity:
      type: object
      required:
        - user_id
        - email
        - display_name
        - org_id
        - org_name
      properties:
        user_id:
          type: string
          description: The ID of the user who created the key.
        email:
          type: string
          nullable: true
          description: That user's email address, or `null` when it isn't available.
        display_name:
          type: string
          nullable: true
          description: That user's first and last name, or `null` when neither is set.
        org_id:
          type: string
          description: >-
            The ID of the organization the key belongs to. Calls made with the
            key draw on this organization's balance and rate limit.
        org_name:
          type: string
          nullable: true
          description: The organization's name, or `null` when it isn't available.
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Short error title, such as `Invalid parameter` or `Not found`.
          example: Invalid parameter
        message:
          type: string
          description: What went wrong and what to change. Sometimes absent.
          example: '"max_results": must be an integer between 1 and 50'
        details:
          description: Structured details, when the error has any.
        retryAfter:
          type: integer
          description: >-
            Seconds to wait before retrying. Present on `429` responses from
            Keenable's own rate limits, matching the `Retry-After` header.
  responses:
    RateLimitExceeded:
      description: >-
        Your organization's per-second limit was exceeded, or search or fetch
        was temporarily rate-limited further down the line (those carry
        `Retry-After: 1`). Wait for `Retry-After`, then retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
    InternalError:
      description: Keenable had an internal error. Retry up to 3 times with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    AuthUnavailable:
      description: >-
        Keenable couldn't verify your key right now (`Authentication temporarily
        unavailable`). Wait for `Retry-After` (5 seconds), then retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your API key, such as `keen_...`. Create one in the Keenable console. If
        you send both this header and `Authorization`, the API uses this one.
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key sent as `Authorization: Bearer keen_...`, for clients that
        only support bearer tokens.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.