Skip to main content

API Key (Optional)

GetProfile uses a simple API key authentication system. For self-hosted deployments, you can optionally protect your proxy with an API key.

Configuration

Set the GETPROFILE_API_KEY environment variable:
If not set, the proxy will accept all requests (useful for local development).

Headers

Required Headers

HeaderDescription
AuthorizationBearer token (only required if GETPROFILE_API_KEY is set)

Optional Headers

HeaderDescription
X-GetProfile-IdYour app’s user identifier
X-Upstream-KeyAPI key for upstream LLM provider
X-GetProfile-TraitsPer-request trait overrides (JSON)

Authentication Methods

Bearer Token (if API key is configured)

No Authentication (local development)

If GETPROFILE_API_KEY is not set, you can make requests without authentication:

SDK Usage

User Identification

The X-GetProfile-Id header identifies which user the request is for. This can be:
  • Your app’s user ID
  • A session ID
  • Any stable identifier for the user
Alternatively, you can use:
  • user field in request body (OpenAI standard)
  • metadata.profile_id in request body

Upstream Authentication

The X-Upstream-Key header provides the API key for the upstream LLM provider:
If you configure a default upstream key in your GetProfile settings, X-Upstream-Key is optional.

Error Responses

StatusErrorDescription
401missing_api_keyNo Authorization header (when API key is configured)
401invalid_api_keyAPI key does not match GETPROFILE_API_KEY
400missing_user_idNo user identifier provided