API Reference
Everything you need to integrate Basktre into your application. Use one API key to access the world's best AI models with built-in cost optimization.
https://api.basktre.inAuthentication
Most API requests must be authenticated using your Basktre API key. You can view and manage your API keys in the Dashboard. Some endpoints, like listing providers, are public and do not require an API key.
/api/v1/providersList Providers
Retrieve a list of all available AI model providers supported by Basktre, including their unique tags and real-time pricing per 1 million tokens.
/api/v1/models/callModel Call
Execute a standard non-streaming request to any supported AI model. You can specify a particular model tag or use 'auto' to let Basktre route your request to the most cost-effective model that meets your performance needs.
Headers
api-keyRequiredYour Basktre API key.
Content-TypeRequiredapplication/json
Body Parameters
modelstringRequiredThe unique tag of the model to use (e.g., 'gpt-4o') or 'auto' for intelligent routing.
messagesarrayRequiredAn array of message objects representing the conversation history. Each message must have a 'role' (one of: 'system', 'user', 'assistant', 'tool') and 'content' (string).
max_tokensnumberThe maximum number of tokens to generate in the completion.
temperaturenumberWhat sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random.
top_pnumberAn alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
stoparrayUp to 4 sequences where the API will stop generating further tokens.
/api/v1/models/streamModel Stream
Execute a streaming request to an AI model. The API will return a stream of Server-Sent Events (SSE) containing partial message deltas as they are generated.
Headers
api-keyRequiredYour Basktre API key.
Content-TypeRequiredapplication/json
Body Parameters
modelstringRequiredThe unique tag of the model to use.
messagesarrayRequiredAn array of message objects representing the conversation history. Each message must have a 'role' (one of: 'system', 'user', 'assistant', 'tool') and 'content' (string).
max_tokensnumberMax generation tokens.
metadataobjectOptional metadata to track requests (e.g., workspace_id, user_id).