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

# Get an API key

> Get details of a specific API key by ID



## OpenAPI

````yaml get /developers/api_keys/{id}
openapi: 3.1.0
info:
  title: Prem API
  description: Full description of private and dev-availble API endpoints
  version: 1.0.0
  termsOfService: https://prem.io/terms
  contact:
    name: API Support
    url: https://help.prem.io
    email: support@premai.io
servers:
  - url: https://gateway.prem.io
    description: Production API server
security: []
paths:
  /developers/api_keys/{id}:
    get:
      tags:
        - API Keys
        - dev-api
      summary: Get an API key
      description: Get details of a specific API key by ID
      operationId: getApiKey
      parameters:
        - name: id
          in: path
          required: true
          description: API Key ID
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/viewDeveloperApiKeyResponse'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
      security:
        - BearerAuth: []
          ApiKeyAuth: []
components:
  responses:
    '400':
      description: Bad request
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: integer
                enum:
                  - 400
                  - 401
                  - 403
                  - 404
                description: Status code of the response
              data:
                type:
                  - object
                  - 'null'
                description: Response data containing the requested object
              error:
                type:
                  - string
                  - 'null'
                examples:
                  - Some error message
                description: Error message of the response, human readable
              message:
                type: 'null'
              env:
                type: string
                enum:
                  - development
                  - production
                description: API environment
              log:
                type:
                  - string
                  - object
                  - 'null'
                examples:
                  - request_id: req_1234567890
                  - Some pertinent log message
                description: Useful informaiton, not always present, to debug the response
              validator:
                type:
                  - object
                  - array
                  - 'null'
                examples:
                  - email: Invalid email address
                    password: Password is required
                description: >-
                  Validator response object, each key is the field name and
                  value is the error message
              support_id:
                type:
                  - string
                  - 'null'
                format: uuid
                examples:
                  - support_uuidv7-something-else
                description: >-
                  Support ID linked to the response, used to identify it when
                  talking with our team
            required:
              - status
              - error
              - message
              - env
              - log
              - support_id
            additionalProperties: false
    '401':
      description: Access token is missing or invalid
      content:
        application/json:
          schema:
            allOf:
              - type: object
                properties:
                  status:
                    type: integer
                    enum:
                      - 400
                      - 401
                      - 403
                      - 404
                    description: Status code of the response
                  data:
                    type:
                      - object
                      - 'null'
                    description: Response data containing the requested object
                  error:
                    type:
                      - string
                      - 'null'
                    examples:
                      - Some error message
                    description: Error message of the response, human readable
                  message:
                    type: 'null'
                  env:
                    type: string
                    enum:
                      - development
                      - production
                    description: API environment
                  log:
                    type:
                      - string
                      - object
                      - 'null'
                    examples:
                      - request_id: req_1234567890
                      - Some pertinent log message
                    description: >-
                      Useful informaiton, not always present, to debug the
                      response
                  validator:
                    type:
                      - object
                      - array
                      - 'null'
                    examples:
                      - email: Invalid email address
                        password: Password is required
                    description: >-
                      Validator response object, each key is the field name and
                      value is the error message
                  support_id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                    examples:
                      - support_uuidv7-something-else
                    description: >-
                      Support ID linked to the response, used to identify it
                      when talking with our team
                required:
                  - status
                  - error
                  - message
                  - env
                  - log
                  - support_id
                additionalProperties: false
              - properties:
                  status:
                    type: integer
                    enum:
                      - 401
    '403':
      description: You do not have the required permissions to access this resource
      content:
        application/json:
          schema:
            allOf:
              - type: object
                properties:
                  status:
                    type: integer
                    enum:
                      - 400
                      - 401
                      - 403
                      - 404
                    description: Status code of the response
                  data:
                    type:
                      - object
                      - 'null'
                    description: Response data containing the requested object
                  error:
                    type:
                      - string
                      - 'null'
                    examples:
                      - Some error message
                    description: Error message of the response, human readable
                  message:
                    type: 'null'
                  env:
                    type: string
                    enum:
                      - development
                      - production
                    description: API environment
                  log:
                    type:
                      - string
                      - object
                      - 'null'
                    examples:
                      - request_id: req_1234567890
                      - Some pertinent log message
                    description: >-
                      Useful informaiton, not always present, to debug the
                      response
                  validator:
                    type:
                      - object
                      - array
                      - 'null'
                    examples:
                      - email: Invalid email address
                        password: Password is required
                    description: >-
                      Validator response object, each key is the field name and
                      value is the error message
                  support_id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                    examples:
                      - support_uuidv7-something-else
                    description: >-
                      Support ID linked to the response, used to identify it
                      when talking with our team
                required:
                  - status
                  - error
                  - message
                  - env
                  - log
                  - support_id
                additionalProperties: false
              - properties:
                  status:
                    type: integer
                    enum:
                      - 403
    '404':
      description: Resource not found
      content:
        application/json:
          schema:
            allOf:
              - type: object
                properties:
                  status:
                    type: integer
                    enum:
                      - 400
                      - 401
                      - 403
                      - 404
                    description: Status code of the response
                  data:
                    type:
                      - object
                      - 'null'
                    description: Response data containing the requested object
                  error:
                    type:
                      - string
                      - 'null'
                    examples:
                      - Some error message
                    description: Error message of the response, human readable
                  message:
                    type: 'null'
                  env:
                    type: string
                    enum:
                      - development
                      - production
                    description: API environment
                  log:
                    type:
                      - string
                      - object
                      - 'null'
                    examples:
                      - request_id: req_1234567890
                      - Some pertinent log message
                    description: >-
                      Useful informaiton, not always present, to debug the
                      response
                  validator:
                    type:
                      - object
                      - array
                      - 'null'
                    examples:
                      - email: Invalid email address
                        password: Password is required
                    description: >-
                      Validator response object, each key is the field name and
                      value is the error message
                  support_id:
                    type:
                      - string
                      - 'null'
                    format: uuid
                    examples:
                      - support_uuidv7-something-else
                    description: >-
                      Support ID linked to the response, used to identify it
                      when talking with our team
                required:
                  - status
                  - error
                  - message
                  - env
                  - log
                  - support_id
                additionalProperties: false
              - properties:
                  status:
                    type: integer
                    enum:
                      - 404
    viewDeveloperApiKeyResponse:
      description: Successful API key view response
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Response200'
              - $ref: '#/components/schemas/viewDeveloperApiKeyResponse'
  schemas:
    Response200:
      type: object
      properties:
        status:
          type: integer
          enum:
            - 200
            - 201
            - 202
          description: Status code of the response
        data:
          type:
            - object
            - array
            - 'null'
          description: Response data containing the requested object
        error:
          type:
            - string
            - 'null'
          examples:
            - Invalid email address
          description: Error message of the response, human readable
        message:
          type:
            - string
            - 'null'
          examples:
            - Resource created successfully
          description: Message of the response, human readable
        env:
          type: string
          enum:
            - development
            - production
          description: API environment
        log:
          type:
            - string
            - object
            - 'null'
          examples:
            - request_id: req_1234567890
            - Some pertinent log message
          description: Useful informaiton, not always present, to debug the response
        validator:
          type:
            - object
            - array
            - 'null'
          examples:
            - email: Invalid email address
              password: Password is required
          description: >-
            Validator response object, each key is the field name and value is
            the error message
        support_id:
          type:
            - string
            - 'null'
          format: uuid
          examples:
            - support_uuidv7-something-else
          description: >-
            Support ID linked to the response, used to identify it when talking
            with our team
      required:
        - status
        - data
        - message
        - env
      examples:
        - status: 200
          data:
            id: '123'
          error: null
          log: null
          validator: null
          support_id: null
          message: Resource created successfully
          env: development
    viewDeveloperApiKeyResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/developersApiKeyView'
      required:
        - data
      examples:
        - data:
            id: api_key_0197c0ec-a197-719f-84a9-99270a79b42a
            secret: sk_test_MDE5N2MwZWMt...GdwdA
            scopes:
              - api_keys.read
            ip_allow_list:
              - 127.0.0.1
              - 192.168.1.0/24
            label: My API Key
            description: Key for reading API Keys
            expires_at: '2026-05-30 20:23:16'
            created_at: '2025-06-30 15:00:22'
            updated_at: '2025-07-01 10:30:45'
            metrics:
              api_key_id: api_key_0197c0ec-a197-719f-84a9-99270a79b42a
              total_requests: 1250
              last_used_at: '2025-07-01 09:15:30'
          message: null
    developersApiKeyView:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the API key
        label:
          type: string
          description: Human-readable label for the API key
          maxLength: 255
        description:
          type:
            - string
            - 'null'
          description: Optional description for the API key
        scopes:
          type: array
          description: List of scopes this API key has access to
          items:
            type: string
        ip_allow_list:
          type: array
          description: List of IP addresses allowed to use this API key
          items:
            type: string
        expires_at:
          type:
            - string
            - 'null'
          format: mysql-date-time
          examples:
            - '2025-06-29 16:03:44'
          description: Timestamp when the API key expires
        secret:
          type: string
          description: Secret key value (only returned when creating a new API key)
        created_at:
          type: string
          format: mysql-date-time
          examples:
            - '2025-06-29 16:03:44'
          description: Timestamp when the API key was created
        updated_at:
          type:
            - string
            - 'null'
          format: mysql-date-time
          examples:
            - '2025-06-29 16:03:44'
          description: Timestamp when the API key was last updated
        metrics:
          oneOf:
            - $ref: '#/components/schemas/apiKeyMetrics'
            - type: 'null'
      required:
        - id
        - scopes
        - created_at
        - updated_at
      additionalProperties: false
      examples:
        - id: api_key_0197c0ec-a197-719f-84a9-99270a79b42a
          secret: sk_test_MDE5N2MwZWMt...GdwdA
          scopes:
            - api_keys.read
          ip_allow_list:
            - 127.0.0.1
          label: My API Key
          description: Key for reading API Keys
          expires_at: '2026-05-30 20:23:16'
          created_at: '2025-06-30 15:05:47'
          updated_at: null
          metrics:
            api_key_id: api_key_0197c0ec-a197-719f-84a9-99270a79b42a
            total_requests: 150
            last_used_at: '2025-06-30 16:03:44'
    apiKeyMetrics:
      type: object
      properties:
        api_key_id:
          type: string
          description: Unique identifier for the webhook
        total_requests:
          type: integer
          description: Total number of webhook deliveries
        last_used_at:
          type:
            - string
            - 'null'
          format: mysql-date-time
          examples:
            - '2025-06-29 16:03:44'
          description: Timestamp when the API key was last used
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Send your access token as header Authorization: Bearer {accessToken}'
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your API key that starts with sk_live or sk_test. You can create yours
        at go.prem.io/api-keys.

````