OpenAI-compatible API endpoints for AI inference.
All API requests require authentication via an API key. Include your API key in the Authorization header using the Bearer scheme.
Authorization: Bearer tl-sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
You can manage your API keys from the Dashboard. Keep your API keys secure and never expose them in client-side code.
https://api.tamgalabs.com/v1
https://api.tamgalabs.com/v1/chat/completions
Creates a model response for a given chat conversation. Compatible with the OpenAI chat completions format.
{
"model": "llama-3.1-405b",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is AI infrastructure?"}
],
"temperature": 0.7,
"max_tokens": 1024,
"stream": false
}
curl https://api.tamgalabs.com/v1/chat/completions \
-H "Authorization: Bearer tl-sk-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "llama-3.1-405b",
"messages": [{"role": "user", "content": "Hello!"}]
}'
from openai import OpenAI
client = OpenAI(
base_url="https://api.tamgalabs.com/v1",
api_key="tl-sk-xxxxxxxx"
)
response = client.chat.completions.create(
model="llama-3.1-405b",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
const response = await fetch('https://api.tamgalabs.com/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': 'Bearer tl-sk-xxxxxxxx',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'llama-3.1-405b',
messages: [{ role: 'user', content: 'Hello!' }]
})
});
const data = await response.json();
console.log(data.choices[0].message.content);
https://api.tamgalabs.com/v1/embeddings
Creates an embedding vector representing the input text. Compatible with the OpenAI embeddings format.
{
"model": "text-embedding-3-large",
"input": "The quick brown fox jumps over the lazy dog"
}
curl https://api.tamgalabs.com/v1/embeddings \
-H "Authorization: Bearer tl-sk-xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "text-embedding-3-large",
"input": "Hello world"
}'
https://api.tamgalabs.com/v1/images/generations
Generates images from text descriptions using supported diffusion models.
{
"model": "stable-diffusion-3",
"prompt": "A serene mountain landscape at sunset",
"n": 1,
"size": "1024x1024"
}
https://api.tamgalabs.com/v1/rerank
Reranks documents based on relevance to a query. Ideal for RAG pipelines and search.
{
"model": "rerank-multilingual-v2",
"query": "What is machine learning?",
"documents": [
"Machine learning is a subset of artificial intelligence.",
"Python is a programming language.",
"Neural networks are inspired by the brain."
],
"top_n": 2
}
https://api.tamgalabs.com/v1/models
Lists all available models for inference.
{
"object": "list",
"data": [
{"id": "llama-3.1-405b", "object": "model", "created": 1720000000, "owned_by": "tamgalabs"},
{"id": "mistral-large-2", "object": "model", "created": 1720000000, "owned_by": "tamgalabs"},
{"id": "stable-diffusion-3", "object": "model", "created": 1720000000, "owned_by": "tamgalabs"}
]
}