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

# Create an API key

> Creates an API key with no account, login or password. The key is optional: send it as `Authorization: Bearer <key>` on any /v1 request so we can identify your client. The key is returned once, so store it.

Create a free API key with a single request. You do not need an account, login, or password. Send the key as `Authorization: Bearer <key>` on any Pricing API request to avoid the [rate limit](https://www.narev.ai/docs/pricing-api/reference/authentication.md#rate-limits).

The key is shown once, so store it. Key creation is limited per address.


## OpenAPI

````yaml pricing-api/reference/openapi.json POST /v1/keys
openapi: 3.0.0
info:
  title: Models Pricing API
  version: 1.0.0
servers:
  - url: https://api.narev.ai
security:
  - {}
  - bearerAuth: []
paths:
  /v1/keys:
    post:
      tags:
        - Keys
      summary: Create an API key
      description: >-
        Creates an API key with no account, login or password. The key is
        optional: send it as `Authorization: Bearer <key>` on any /v1 request so
        we can identify your client. The key is returned once, so store it.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 64
                  example: my-pricing-agent
      responses:
        '201':
          description: The new key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  key:
                    type: string
                    example: narev_2bFq...
                  key_id:
                    type: string
                  created_at:
                    type: string
                  usage:
                    type: string
                required:
                  - key
                  - key_id
                  - created_at
                  - usage
        '429':
          description: >-
            Too many keys created from this address. Retry after the number of
            seconds in the `Retry-After` header.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      type:
                        type: string
                      code:
                        type: string
                    required:
                      - message
                      - type
                      - code
                required:
                  - error
        '500':
          description: The key could not be created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      type:
                        type: string
                      code:
                        type: string
                    required:
                      - message
                      - type
                      - code
                required:
                  - error
      security: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Optional API key. Create one without an account via POST /v1/keys and
        send it as `Authorization: Bearer <key>`.

````

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