OpenAI-compatible endpoints for chat, responses, images, and embeddings
Welcome to the AI Playground API. This service provides OpenAI-compatible access to locally-hosted Mistral language models, SDXL image generation, and embeddings.
https://api.playground.8ase0f0ps.com/v1
Call GET /v1/models to see which model is currently loaded, then use that model name in your requests. The server runs one text model at a time — the active model depends on the current mode.
The server runs one text model at a time. The administrator can switch between modes. Use GET /v1/models to discover the currently active model name.
| Mode | Model Name | Underlying Model | Parameters | Context | Best For |
|---|---|---|---|---|---|
| extreme | extreme |
Mistral-Small-3.2-24B-Instruct-2506 | 24B | 49K | General conversation, reasoning |
| code | code |
Devstral-Small-2-24B-Instruct-2512 | 24B | 65K | Programming, code completion |
| fast | fast |
Ministral-3-14B-Instruct-2512 | 14B | 98K | Quick responses, batched requests |
model field, the gateway fills in the current default automatically.
sdxl-1.0 — SDXL 1.0 via InvokeAI (1024×1024 default)nomic-embedding — Nomic Embed for memory and searchAll API requests require a Bearer token in the Authorization header.
Authorization: Bearer pg_your_api_key_here
/v1/chat/completions
Chat completions (streaming & tool calling supported)
/v1/responses
Compatible
Responses API with tool support (mapped to chat completions when needed)
/v1/embeddings
Generate embeddings for memory and search
/v1/images/generations
Generate images using SDXL
/v1/models
List available models
from openai import OpenAI
client = OpenAI(
api_key="pg_your_api_key_here",
base_url="https://api.playground.8ase0f0ps.com/v1"
)
# Discover the active model
models = client.models.list()
active_model = models.data[0].id # e.g. "extreme", "fast", or "code"
print(f"Active model: {active_model}")
# Chat completion
response = client.chat.completions.create(
model=active_model,
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
response = client.responses.create(
model="extreme", # or "fast", "code" — whichever is active
input="Summarize the project status."
)
print(response.output_text)
emb = client.embeddings.create(
model="nomic-embedding",
input=["searchable memory"]
)
print(emb.data[0].embedding[:5])
const OpenAI = require('openai');
const openai = new OpenAI({
apiKey: 'pg_your_api_key_here',
baseURL: 'https://api.playground.8ase0f0ps.com/v1'
});
(async () => {
// Discover the active model
const models = await openai.models.list();
const activeModel = models.data[0]?.id || 'fast';
const completion = await openai.chat.completions.create({
model: activeModel,
messages: [{ role: 'user', content: 'Hello!' }]
});
console.log(completion.choices[0].message.content);
})();
curl https://api.playground.8ase0f0ps.com/v1/models \
-H "Authorization: Bearer pg_your_api_key_here"
# Use the model name returned by /v1/models (e.g. "extreme", "fast", "code")
curl https://api.playground.8ase0f0ps.com/v1/chat/completions \
-H "Authorization: Bearer pg_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "fast",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'
curl https://api.playground.8ase0f0ps.com/v1/responses \
-H "Authorization: Bearer pg_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "extreme",
"input": "Write a short welcome message."
}'
Stream tokens for real-time output with chat completions.
response = client.chat.completions.create(
model="fast",
messages=[{"role": "user", "content": "Write a story"}],
stream=True
)
for chunk in response:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
The API supports OpenAI-compatible tool calling. Define tools in your request and the model will respond with structured tool_calls when appropriate.
response = client.chat.completions.create(
model="fast",
messages=[{"role": "user", "content": "What is the weather in Paris?"}],
tools=[{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City name"}
},
"required": ["location"]
}
}
}],
tool_choice="auto"
)
# Check if the model wants to call a tool
message = response.choices[0].message
if message.tool_calls:
for tc in message.tool_calls:
print(f"Tool: {tc.function.name}")
print(f"Args: {tc.function.arguments}")
The /v1/responses endpoint also supports tools. Tool calls are returned as function_call output items.
response = client.responses.create(
model="fast",
input="Read the file at /tmp/notes.txt",
tools=[{
"type": "function",
"name": "read_file",
"description": "Read a file from disk",
"parameters": {
"type": "object",
"properties": {
"path": {"type": "string", "description": "File path"}
},
"required": ["path"]
}
}]
)
for item in response.output:
if item.type == "function_call":
print(f"Call: {item.name}({item.arguments})")
curl https://api.playground.8ase0f0ps.com/v1/chat/completions \
-H "Authorization: Bearer pg_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "fast",
"messages": [{"role": "user", "content": "What is 2+2?"}],
"tools": [{
"type": "function",
"function": {
"name": "calculator",
"description": "Evaluate a math expression",
"parameters": {
"type": "object",
"properties": {
"expression": {"type": "string"}
},
"required": ["expression"]
}
}
}]
}'
"tool_choice": "auto" (default when tools are provided) to let the model decide.functions/ prefixes from tool names automatically.finish_reason: "tool_calls".content is cleared to avoid leaking internal reasoning.import requests
url = "https://api.playground.8ase0f0ps.com/v1/images/generations"
headers = {
"Authorization": "Bearer pg_your_api_key_here",
"Content-Type": "application/json"
}
data = {
"model": "sdxl-1.0",
"prompt": "a beautiful sunset over mountains",
"n": 1,
"size": "1024x1024"
}
response = requests.post(url, headers=headers, json=data)
image_data = response.json()["data"][0]["b64_json"]
usage.X-Usage-Prompt-Tokens, X-Usage-Completion-Tokens, X-Usage-Total-Tokens.{"type":"usage"}.200 - Success401 - Unauthorized (invalid API key)429 - Rate limit exceeded500 - Server error502 - Gateway error (upstream service unavailable){
"error": {
"code": "upstream_http",
"message": "Upstream request failed.",
"hint": "Check upstream and retry.",
"details": "..."
}
}
For support, questions, or to request an API key: