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

# Read the calling key

> The calling API key, its organization and its owner. `scopes` lists what the key can do now: its scopes that the owner's role still allows.

Needs no scope.



## OpenAPI

````yaml /openapi.json get /me
openapi: 3.1.0
info:
  title: ZeroGen API
  version: v1
  description: >-
    Generate images and video with every model in ZeroGen from your own servers.
    Generated from the API's contracts by `npm run openapi` in apps/web; do not
    edit by hand.
servers:
  - url: https://api.zerogen.com/v1
security:
  - bearerAuth: []
tags:
  - name: Account
    description: The calling key and the organization's balance.
  - name: Models
    description: The models an organization can run and their schemas.
  - name: Generations
    description: Quote, create, read, list and cancel generations.
  - name: Uploads
    description: Upload files into the Library to use as inputs.
paths:
  /me:
    get:
      tags:
        - Account
      summary: Read the calling key
      description: >-
        The calling API key, its organization and its owner. `scopes` lists what
        the key can do now: its scopes that the owner's role still allows.


        Needs no scope.
      operationId: getMe
      responses:
        '200':
          description: The calling key.
          headers:
            Request-Id:
              $ref: '#/components/headers/Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Me'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  headers:
    Request-Id:
      description: Identifies the request; quote it when contacting support.
      schema:
        type: string
    RateLimit-Limit:
      description: Requests the key may make in the current window.
      schema:
        type: integer
    RateLimit-Remaining:
      description: Requests left in the current window.
      schema:
        type: integer
    RateLimit-Reset:
      description: Seconds until the current window resets.
      schema:
        type: integer
    WWW-Authenticate:
      description: Bearer realm="ZeroGen API".
      schema:
        type: string
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  schemas:
    Me:
      type: object
      properties:
        apiKey:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            mode:
              type: string
              enum:
                - live
                - test
              description: >-
                test keys run on placeholder providers, charge nothing and stay
                in the sandbox
            scopes:
              type: array
              items:
                type: string
              description: >-
                What this key can do now: its scopes that its owner's role still
                allows
            createdAt:
              type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
            expiresAt:
              anyOf:
                - type: string
                  format: date-time
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                - type: 'null'
              description: When the key stops working; null for never
          required:
            - id
            - name
            - mode
            - scopes
            - createdAt
            - expiresAt
          additionalProperties: false
        organization:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
          required:
            - id
            - name
          additionalProperties: false
        user:
          type: object
          properties:
            id:
              type: string
          required:
            - id
          additionalProperties: false
          description: The key's owner, whom it acts as
        sandbox:
          anyOf:
            - type: object
              properties:
                projectId:
                  type: string
              required:
                - projectId
              additionalProperties: false
            - type: 'null'
          description: 'Test keys only: the project every request of the key is confined to'
      required:
        - apiKey
        - organization
        - user
        - sandbox
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
      additionalProperties: false
    Error:
      type: object
      properties:
        code:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,79}$
        message:
          type: string
        param:
          type: string
        retryable:
          type: boolean
        details:
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - code
        - message
        - retryable
      additionalProperties: false
  responses:
    Unauthorized:
      description: 'invalid_api_key: the key is missing, revoked or expired.'
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        WWW-Authenticate:
          $ref: '#/components/headers/WWW-Authenticate'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: >-
        permission_denied: the key lacks the scope this endpoint needs, the
        request came from a browser, or the API isn't enabled for the
        organization.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: >-
        rate_limited: the key or its owner is over the rate limit, or the
        organization is at its running cap. Retry after Retry-After seconds.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: 'internal: something went wrong. Retry.'
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: >-
        unavailable or pricing_unavailable: API keys, billing or pricing can't
        be reached right now. Retry.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'A ZeroGen API key: zg_ for a live key, zg_test_ for a test key.'

````

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