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

# Get current key (me)

> Introspect the authenticated key, its organization, and available credits.

Returns `{ organization, api_key, credits }` for the presented key — the
organization id and name, the key's safe metadata (id, name, prefix, scopes,
expiry — never the secret), and the organization's available credit balance. This is
the fastest way to confirm a key works. `GET /me` requires **any** valid key and no
specific scope.


## OpenAPI

````yaml api-reference/openapi.json GET /me
openapi: 3.1.0
info:
  title: Samsa API
  description: >-
    The Samsa public REST API. Authenticate with an organization API key as a
    bearer token (`Authorization: Bearer samsa_sk_...`). Errors follow a single
    envelope shape; every response carries an `X-Request-ID`.
  version: 1.0.0
servers:
  - url: https://api.samsa.ai/public/v1
security:
  - BearerAuth: []
paths:
  /me:
    get:
      tags:
        - Account
      summary: Introspect the authenticated key, its organization, and credits
      description: Return ``{organization, api_key, credits}`` for the presented key.
      operationId: read_me_me_get
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeResponse'
        '401':
          description: Missing, invalid, expired, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '402':
          description: Insufficient credits or inactive subscription.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: The API key lacks the required scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Request validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    MeResponse:
      properties:
        organization:
          $ref: '#/components/schemas/OrganizationInfo'
        api_key:
          $ref: '#/components/schemas/ApiKeyInfo'
        credits:
          $ref: '#/components/schemas/CreditsInfo'
      type: object
      required:
        - organization
        - api_key
        - credits
      title: MeResponse
      description: >-
        ``GET /me`` body — the quickstart smoke response (ADR §10, scope item
        5).
    ErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - error
      title: ErrorEnvelope
      description: The complete public error body — an ``error`` object wrapper (ADR §5).
    OrganizationInfo:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: OrganizationInfo
      description: The key's organization (the billing / rate-limit identity, ADR §3.1).
    ApiKeyInfo:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        prefix:
          type: string
          title: Prefix
          description: Display prefix `samsa_sk_xxxx` (never the full key).
        scopes:
          items:
            type: string
          type: array
          title: Scopes
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
      type: object
      required:
        - id
        - name
        - prefix
        - scopes
      title: ApiKeyInfo
      description: The presented key's safe, re-displayable metadata (never secrets).
    CreditsInfo:
      properties:
        available:
          type: integer
          title: Available
      type: object
      required:
        - available
      title: CreditsInfo
      description: The organization's currently available credit balance.
    ErrorDetail:
      properties:
        type:
          type: string
          title: Type
          examples:
            - authentication_error
        code:
          type: string
          title: Code
          examples:
            - invalid_api_key
        message:
          type: string
          title: Message
          examples:
            - The provided API key is invalid, expired, or revoked.
        request_id:
          type: string
          title: Request Id
          examples:
            - 8f14e45fceea167a5a36dedd4bea2543
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
          description: Present on validation errors — names the offending field.
          examples:
            - aspect_ratio
      type: object
      required:
        - type
        - code
        - message
        - request_id
      title: ErrorDetail
      description: The ``error`` object of the public envelope (ADR §5).
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key as a bearer token: `Authorization: Bearer
        samsa_sk_...`.

````