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

# Create key



## OpenAPI

````yaml /api-reference/ageneral-project-keys-openapi.json post /v1/projects/{project_id}/keys
openapi: 3.1.0
info:
  title: Keys
  version: 1.0.0
  description: >-
    Keys under a **project id** in the path: create, list, delete, and per-key
    budget.


    **JSON** over **HTTPS** with **camelCase** field names.


    **Authentication:** `Authorization: Bearer <session JWT>` from Ageneral
    sign-in. **Base URL:** `https://ageneral.ai`.
  contact:
    name: Ageneral
    url: https://ageneral.ai
servers:
  - url: https://ageneral.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Keys
    description: Keys and budgets under `/v1/projects/{project_id}/keys`.
paths:
  /v1/projects/{project_id}/keys:
    post:
      tags:
        - Keys
      summary: Create key
      operationId: createProjectKey
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProjectKeyRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateProjectKeyResponse'
        '401':
          description: Missing or invalid session.
        '403':
          description: Forbidden for this user or project.
        '404':
          description: Resource not found.
components:
  schemas:
    CreateProjectKeyRequest:
      type: object
      required:
        - projectId
        - name
      properties:
        projectId:
          type: string
        name:
          type: string
    CreateProjectKeyResponse:
      type: object
      properties:
        key:
          $ref: '#/components/schemas/ProjectKey'
    ProjectKey:
      type: object
      properties:
        id:
          type: string
        projectId:
          type: string
        userId:
          type: string
        name:
          type: string
        keyId:
          type: string
        keyValue:
          type: string
        createdAt:
          type: string
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Ageneral session JWT. Obtain through web sign-in or extension OAuth.

````