Create Api Key

Create a new API key.

This endpoint creates a new API key for the organization and returns the created key details.

Parameters:
api_key (ApiKeyCreate): The API key data to create
request (Request): The FastAPI request object
db (AsyncSession): The database session (injected)
organization_id (Optional[int]): The organization ID from the API key or request

Returns:
ApiKey: The created API key

Raises:
HTTPException:
- 400: If organization ID is missing
- 422: If there's a validation error in the request body
- 500: If an unexpected error occurs during creation

Language
Credentials
Header
Click Try It! to start a request and see the response here!