Skip to main content

Module auth

Module auth 

Source
Expand description

Authentication types for the ObjectiveAI API.

This module provides types for API key management and authentication, including creating, listing, and disabling API keys, as well as managing credits and OpenRouter BYOK (Bring Your Own Key) integration.

§API Keys

API keys are prefixed UUIDs with the format apk<uuid> (e.g., apk1234abcd...). They are used to authenticate requests to the ObjectiveAI API.

§Credits

Credits are the billing unit for ObjectiveAI. Users can check their current balance, total purchased, and total used credits.

Modules§

request
Request types for authentication API endpoints.
response
Response types for authentication API endpoints.

Structs§

ApiKeyWithMetadata
An ObjectiveAI API Key with associated metadata.

Functions§

create_api_key
Creates a new API key.
create_openrouter_byok_api_key
Creates or updates the OpenRouter BYOK API key.
delete_openrouter_byok_api_key
Deletes the OpenRouter BYOK API key.
disable_api_key
Disables an existing API key.
get_credits
Retrieves the user’s credit balance.
get_openrouter_byok_api_key
Retrieves the configured OpenRouter BYOK API key.
list_api_keys
Lists all API keys for the authenticated user.

Type Aliases§

ApiKey
An ObjectiveAI API Key.