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

# Retrieve context



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /auth/context
openapi: 3.1.0
info:
  description: API-key accessible routes for Cerca agents.
  title: Cerca API
  version: 0.0.0
servers:
  - url: https://api.cerca.dev
security:
  - bearerAuth: []
paths:
  /auth/context:
    get:
      tags:
        - Auth
      summary: Retrieve context
      responses:
        '200':
          description: API key authentication context.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthContextResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Cerca from '@cerca-dev/sdk';

            const client = new Cerca({
              apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
            });

            const authContextResponse = await client.auth.context();

            console.log(authContextResponse.keyId);
        - lang: Python
          source: |-
            import os
            from cerca import Cerca

            client = Cerca(
                api_key=os.environ.get("CERCA_API_KEY"),  # This is the default and can be omitted
            )
            auth_context_response = client.auth.context()
            print(auth_context_response.key_id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/matrices/cerca-go\"\n\t\"github.com/matrices/cerca-go/option\"\n)\n\nfunc main() {\n\tclient := cercago.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tauthContextResponse, err := client.Auth.Context(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", authContextResponse.KeyID)\n}\n"
        - lang: Ruby
          source: |-
            require "cerca"

            cerca = Cerca::Client.new(api_key: "My API Key")

            auth_context_response = cerca.auth.context

            puts(auth_context_response)
        - lang: CLI
          source: |-
            cerca auth context \
              --api-key 'My API Key'
components:
  schemas:
    AuthContextResponse:
      type: object
      properties:
        keyId:
          type: string
        orgId:
          type: string
      required:
        - keyId
        - orgId
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine-readable error code when the API can provide one.
          example: MONTHLY_TOKEN_BUDGET_EXCEEDED
      required:
        - error
  securitySchemes:
    bearerAuth:
      bearerFormat: Cerca API key
      scheme: bearer
      type: http

````