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.

Base URLhttps://api.basktre.in

Authentication

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.

Header Example
api-key: bk_live_xxxxxxxxxxxxxxxxxxxxxxxx
GET/api/v1/providers

List 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.

curl --location 'https://api.basktre.in/api/v1/providers'
POST/api/v1/models/call

Model 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-keyRequired

Your Basktre API key.

Content-TypeRequired

application/json

Body Parameters

modelstringRequired

The unique tag of the model to use (e.g., 'gpt-4o') or 'auto' for intelligent routing.

messagesarrayRequired

An array of message objects representing the conversation history. Each message must have a 'role' (one of: 'system', 'user', 'assistant', 'tool') and 'content' (string).

max_tokensnumber

The maximum number of tokens to generate in the completion.

temperaturenumber

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random.

top_pnumber

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.

stoparray

Up to 4 sequences where the API will stop generating further tokens.

curl --location 'https://api.basktre.in/api/v1/models/call' \
--header 'api-key: <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
  "model": "deepseek-v4-flash",
  "messages": [
    { "role": "system", "content": "You are a helpful AI assistant." },
    { "role": "user", "content": "how to plan a road trip" }
  ],
  "max_tokens": 300,
  "temperature": 0.7
}'
POST/api/v1/models/stream

Model 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-keyRequired

Your Basktre API key.

Content-TypeRequired

application/json

Body Parameters

modelstringRequired

The unique tag of the model to use.

messagesarrayRequired

An array of message objects representing the conversation history. Each message must have a 'role' (one of: 'system', 'user', 'assistant', 'tool') and 'content' (string).

max_tokensnumber

Max generation tokens.

metadataobject

Optional metadata to track requests (e.g., workspace_id, user_id).

curl --location 'https://api.basktre.in/api/v1/models/stream' \
--header 'api-key: <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
  "model": "claude-sonnet-4-6",
  "messages": [
    { "role": "user", "content": "Explain what an API gateway is in simple terms." }
  ],
  "max_tokens": 300
}'