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

# Current principal

> Auth type plus, for API keys, the org and project scoped to the key.



## OpenAPI

````yaml /openapi.yaml get /v1/me
openapi: 3.1.0
info:
  title: Kupe API
  version: 0.1.0
  description: >-
    Public Kupe REST API. Authenticate with `Authorization: Bearer sk-kupe-...`
    (project API key) or a Supabase user JWT. API-key callers can GET /v1/me for
    the org_id and project_id scoped to the key.
servers:
  - url: https://x.kupe.in
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Me
    description: Current principal — org and project scoped to an API key.
  - name: Agents
    description: Agent CRUD, versions, tools, analyses, memories, and tests.
  - name: Realtime
    description: Mint an ephemeral Realtime session for the WebSocket.
  - name: Sessions
    description: LiveKit web sessions and telephony call sessions.
  - name: Inbound
    description: Bind an agent to a phone number with availability windows.
  - name: Campaigns
    description: 'Outbound batches: contacts, schedule, start/pause/resume.'
  - name: Recipient lists
    description: Reusable contact lists that attach to campaigns.
  - name: Tools
    description: Org tool catalog (webhooks, MCP, Composio-backed).
  - name: Composio
    description: Connect third-party apps and attach actions as tools.
  - name: Analyses
    description: Post-call analysis configs and session results.
  - name: Databases
    description: Call databases, rows, export, and agent attachments.
  - name: Knowledge bases
    description: Files and RAG search for agent context.
  - name: Audio assets
    description: Ambient audio presets and project uploads.
  - name: Phones
    description: Search, buy, and manage telephony numbers.
  - name: Voices
    description: Catalog voices, clones, preview, and speak.
  - name: Providers
    description: STT, LLM, and TTS catalog (defaults + enabled models).
  - name: Logs
    description: Session transcripts, recordings, and tool-call events.
  - name: Billing
    description: Wallet balance and invoices (not checkout).
  - name: Usage
    description: Cost summary and daily usage (no per-service breakdown).
  - name: Orgs
    description: Organizations.
  - name: Projects
    description: Projects inside an org.
  - name: Members
    description: Org membership.
  - name: API keys
    description: Project API keys (`sk-kupe-...`).
  - name: Feature flags
    description: Workspace feature flags.
  - name: Health
    description: Liveness and readiness probes.
paths:
  /v1/me:
    get:
      tags:
        - Me
      summary: Current principal
      description: Auth type plus, for API keys, the org and project scoped to the key.
      operationId: get_me_v1_me_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeOut'
      x-codeSamples:
        - lang: python
          label: Python
          source: |-
            from kupe import Kupe

            client = Kupe()  # KUPE_API_KEY
            me = client.me()
            print(me.org_id, me.project_id)
        - lang: typescript
          label: TypeScript
          source: |-
            import { Kupe } from "kupe-sdk";

            const kupe = new Kupe(); // KUPE_API_KEY
            const me = await kupe.me();
            console.log(me.org_id, me.project_id);
        - lang: bash
          label: cURL
          source: |-
            curl https://x.kupe.in/v1/me \
              -H "Authorization: Bearer sk-kupe-YOUR_KEY"
components:
  schemas:
    MeOut:
      properties:
        auth:
          type: string
          enum:
            - api_key
            - jwt
          title: Auth
          description: >-
            Credential type: project API key (`sk-kupe-...`) or a Supabase user
            JWT.
        org_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Id
          description: Org scoped to this API key. Null for JWT callers.
        project_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Project Id
          description: Project scoped to this API key. Null for JWT callers.
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: Supabase user id. Set for JWT callers.
        api_key_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Key Id
          description: API key row id. Set for API-key callers.
      type: object
      required:
        - auth
        - org_id
        - project_id
        - user_id
        - api_key_id
      title: MeOut
      description: |-
        Caller identity derived from the verified Principal.

        API keys are always scoped to one org + project, so SDK clients can
        list agents without the caller passing those IDs. JWT (dashboard)
        callers are not project-scoped; org_id and project_id are null.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: Project API key (`sk-kupe-...`) or a Supabase user JWT.

````