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

# Mint an agent token

> Trades the SDK key for an agent token for one person of yours, valid for 15 minutes. Requires the key's `agent:read` scope and the assistant switched on for the organization. Your backend sends the token to the assistant and to its MCP reads; it never reaches a browser.

**Beta.** The assistant API and its reads over MCP are in beta. They are open to every
organization that pays out through Grade, and parts are not available yet, as each page says.


## OpenAPI

````yaml agent/openapi.json POST /sdk/v1/agent/token
openapi: 3.0.3
info:
  title: Grade assistant API
  version: '1'
  description: >-
    The SDK routes of the assistant API: mint an agent token, and commit a
    proposal.
servers:
  - url: https://infra.usegrade.com/api/email
    description: Production
  - url: https://infra-sandbox.usegrade.com/api
    description: Sandbox
security:
  - applicationId: []
    apiKey: []
tags:
  - name: Assistant
paths:
  /sdk/v1/agent/token:
    post:
      tags:
        - Assistant
      summary: Mint an agent token
      description: >-
        Trades the SDK key for an agent token for one person of yours, valid for
        15 minutes. Requires the key's `agent:read` scope and the assistant
        switched on for the organization. Your backend sends the token to the
        assistant and to its MCP reads; it never reaches a browser.
      operationId: agentToken
      requestBody:
        required: true
        description: Who is asking.
        content:
          application/json:
            schema:
              type: object
              required:
                - end_user
              additionalProperties: false
              properties:
                end_user:
                  type: string
                  pattern: ^[\w-]{1,128}$
                  description: >-
                    Your id for the person asking: letters, digits, `_` or `-`.
                    Opaque to Grade, never an email.
                  example: user_8f3a2c
      responses:
        '200':
          description: The agent token.
          content:
            application/json:
              schema:
                type: object
                required:
                  - token
                  - expires_at
                  - api_version
                properties:
                  token:
                    type: string
                    description: 'The agent token, sent as `Authorization: Bearer <token>`.'
                  expires_at:
                    type: string
                    format: date-time
                  api_version:
                    type: integer
                    enum:
                      - 1
        '400':
          description: 'The body is not `{ "end_user": string }` with a valid id.'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - code
                  - message
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                    enum:
                      - INVALID_REQUEST
                  message:
                    type: string
        '403':
          description: The assistant is not open to this organization.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - code
                  - message
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                    enum:
                      - AGENT_DISABLED
                      - AGENT_IMPERSONATION_ONLY
                  message:
                    type: string
        '503':
          description: The assistant is not configured on this environment.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - code
                  - message
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  code:
                    type: string
                    enum:
                      - AGENT_UNCONFIGURED
                  message:
                    type: string
components:
  securitySchemes:
    applicationId:
      type: apiKey
      in: header
      name: X-Application-Id
    apiKey:
      type: apiKey
      in: header
      name: X-Api-Key

````

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