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

# Get customer

> Get a customer by ID



## OpenAPI

````yaml /openapi.json get /customers/{customer_id}
openapi: 3.0.0
info:
  title: Lava API
  description: >-
    Lava API enables businesses to implement usage-based billing for AI
    services. This API allows tracking, managing, and billing for third-party AI
    API usage through a forwarding system.
  version: 1.0.0
  contact:
    name: Lava support
    url: https://www.lava.so/contact
servers:
  - url: https://api.lava.so/v1/
    description: Lava API v1
security: []
tags:
  - name: Authentication
  - name: Core Endpoints
  - name: Models
  - name: Services
  - name: Requests
  - name: Wallet
  - name: Payment Methods
  - name: Spend Keys
  - name: Usage
  - name: Checkout Sessions
  - name: Customers
  - name: Plans
  - name: Subscriptions
  - name: Meters
  - name: Webhooks
  - name: Secret Keys
  - name: Credit Bundles
  - name: Gateway Settings
  - name: Skills
  - name: News Data
  - name: Search
  - name: Enrich
paths:
  /customers/{customer_id}:
    get:
      tags:
        - Customers
      summary: Get customer
      description: Get a customer by ID
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
          description: Customer ID
      responses:
        '200':
          description: Customer details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                auth_header_missing:
                  summary: Authorization header missing
                  value:
                    error:
                      message: >-
                        Authorization header is required. Please include an
                        'Authorization' header with your request.
                      code: auth_header_missing
                      status: 401
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                customer_not_found:
                  summary: Customer not found
                  value:
                    error:
                      message: Customer not found.
                      code: customer_not_found
                      status: 404
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                rest_internal_server_error:
                  summary: Internal server error
                  value:
                    error:
                      message: >-
                        An internal server error occurred while processing your
                        request.
                      code: rest_internal_server_error
                      status: 500
      security:
        - Auth: []
components:
  schemas:
    Customer:
      type: object
      properties:
        customer_id:
          type: string
          example: con_test_01EXAMPLE00000000000000001
          description: Unique identifier for the customer
        reference_id:
          type: string
          nullable: true
          example: usr_abc123
          description: >-
            Merchant's external identifier for this customer. Used for
            idempotent creation — POST with the same reference_id returns the
            existing customer.
        contact:
          type: object
          properties:
            phone:
              type: string
              example: '+14155552671'
              description: User's phone number in E.164 format
            email:
              type: string
              example: user@example.com
              description: User's email address
            first_name:
              type: string
              example: Jane
              description: User's first name
            last_name:
              type: string
              example: Smith
              description: User's last name
          required:
            - phone
            - email
            - first_name
            - last_name
        subscription:
          type: object
          nullable: true
          properties:
            subscription_id:
              type: string
              description: Subscription ID
            plan_id:
              type: string
              description: Plan ID
            name:
              type: string
              description: Display name of the plan
            status:
              type: string
              enum:
                - active
                - cancelled
              description: Subscription status
          required:
            - subscription_id
            - plan_id
            - name
            - status
          description: Active subscription summary, or null if none
        metadata:
          type: object
          nullable: true
          additionalProperties: true
          example:
            plan_tier: enterprise
            internal_id: '12345'
          description: Arbitrary key-value metadata stored on the customer. Set via PATCH.
        created_at:
          type: string
          format: date-time
          example: '2023-05-15T08:35:42Z'
          description: ISO 8601 timestamp when the customer was created
      required:
        - customer_id
        - reference_id
        - contact
        - subscription
        - metadata
        - created_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error message describing what went wrong
              example: Invalid authentication credentials
            code:
              type: string
              description: Machine-readable error code describing what went wrong
              example: forward_token_json_invalid
            status:
              type: integer
              description: HTTP status code of the error
              example: 400
            issues:
              type: array
              items:
                type: object
                properties:
                  path:
                    type: array
                    items:
                      type: string
                    description: Path to the field that caused the validation error
                  message:
                    type: string
                    description: Error message describing the validation issue
                required:
                  - path
                  - message
              description: >-
                Optional array of specific validation issues with their paths
                and messages
              example:
                - path:
                    - model
                  message: 'Missing required field: model'
                - path:
                    - messages
                    - '0'
                    - content
                  message: Invalid message content format
          required:
            - message
            - code
            - status
      required:
        - error
  securitySchemes:
    Auth:
      type: http
      scheme: bearer
      description: >-
        Bearer token authentication used for standard API calls. Format: 'Bearer
        YOUR_API_KEY'

````