← Back to Catalog

Playground API Documentation

HTTP API for testing models programmatically

Base URL

https://featherless.kim8.s4s.host/api

All endpoints accept and return JSON. Use POST for mutations, GET for queries.

GET /api/routes

List all available API routes.

curl https://featherless.kim8.s4s.host/api/routes
{"success":true,"message":"OK","data":{"routes":[ {"method":"POST","path":"/api/chat","description":"Send chat completion request"}, {"method":"POST","path":"/api/vision","description":"Send vision/image analysis request"}, ... ]}}

GET /api/health

Health check endpoint.

curl https://featherless.kim8.s4s.host/api/health
{"success":true,"message":"OK","data":{"status":"healthy","timestamp":1711000000}}

GET /api/models

Returns all categories with model counts.

curl https://featherless.kim8.s4s.host/api/models

GET /api/search?q=

Search models by name (case-insensitive). Max 50 results.

curl "https://featherless.kim8.s4s.host/api/search?q=qwen"
{"success":true,"data":{"query":"qwen","count":50,"results":[ {"id":"Qwen/Qwen2.5-72B-Instruct","size":"72B","context":32768,"categories":["chat","reasoning","math"]}, ... ]}}

POST /api/chat

Send a chat completion request to a model.

Parameters

FieldTypeRequiredDescription
modelstringyesModel ID (alphanumeric + / - _ ., max 200 chars)
messagesarrayyes1-10 message objects with role and content
system_promptstringnoSystem prompt (prepended if no system message in array)
temperaturefloatno0.0 - 2.0, default 0.7
max_tokensintno1 - 32000, default 500

Example - curl

curl -X POST https://featherless.kim8.s4s.host/api/chat \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen2.5-72B-Instruct",
    "messages": [{"role": "user", "content": "What is 2+2?"}],
    "temperature": 0.5,
    "max_tokens": 100
  }'

Example - JavaScript

const resp = await fetch('/api/chat', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    model: 'Qwen/Qwen2.5-72B-Instruct',
    messages: [{ role: 'user', content: 'What is 2+2?' }],
    temperature: 0.5,
    max_tokens: 100
  })
});
const data = await resp.json();
console.log(data.data.content);

Response

{"success":true,"message":"OK","data":{ "content":"The answer is 4.", "model":"Qwen/Qwen2.5-72B-Instruct", "usage":{"prompt_tokens":15,"completion_tokens":5,"total_tokens":20}, "elapsed":2.34 }}

POST /api/vision

Send a vision/image analysis request. Model must be in the vision category.

Parameters

FieldTypeRequiredDescription
modelstringyesMust be a vision-capable model
promptstringyesText prompt describing what to analyze
imagestringyesImage URL or base64 data URI
image_typestringno"url" (default) or "base64"

Example - curl

curl -X POST https://featherless.kim8.s4s.host/api/vision \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3-VL-30B-A3B-Instruct",
    "prompt": "Describe this image",
    "image": "https://example.com/photo.jpg",
    "image_type": "url"
  }'

Example - base64 upload

curl -X POST https://featherless.kim8.s4s.host/api/vision \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3-VL-30B-A3B-Instruct",
    "prompt": "What text is in this image?",
    "image": "data:image/png;base64,iVBORw0KGgo...",
    "image_type": "base64"
  }'

POST /api/ocr

Extract text from an image via OCR. Uses a fixed prompt internally. Model must be vision-capable.

Parameters

FieldTypeRequiredDescription
modelstringyesMust be a vision-capable model
imagestringyesImage URL or base64 data URI
image_typestringno"url" (default) or "base64"

Example - curl

curl -X POST https://featherless.kim8.s4s.host/api/ocr \
  -H "Content-Type: application/json" \
  -d '{
    "model": "mistralai/Magistral-Small-2506",
    "image": "https://example.com/receipt.jpg"
  }'

Multi-Model Sequential Processing

To compare multiple models, run them sequentially (one at a time) to respect API rate limits:

const models = [
  'Qwen/Qwen2.5-72B-Instruct',
  'Qwen/Qwen2.5-32B-Instruct',
  'mistralai/Mistral-Small-3.2-24B-Instruct-2506'
];
const prompt = 'Explain quantum computing in one sentence.';
const results = [];

for (let i = 0; i < models.length; i++) {
  console.log(`Running model ${i + 1} of ${models.length}: ${models[i]}`);
  try {
    const resp = await fetch('/api/chat', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        model: models[i],
        messages: [{ role: 'user', content: prompt }],
        max_tokens: 200
      })
    });
    const data = await resp.json();
    if (data.success) {
      results.push({ model: models[i], ...data.data });
    } else {
      results.push({ model: models[i], error: data.error });
    }
  } catch (err) {
    results.push({ model: models[i], error: err.message });
  }
}

console.log('All models completed:', results);

QA Software Integration Example

For automated testing pipelines:

#!/bin/bash
# test_models.sh - Run a prompt against multiple models
PROMPT="Write a Python function to reverse a string"
MODELS=("Qwen/Qwen2.5-7B-Instruct" "mistralai/Mistral-7B-Instruct-v0.3")

for MODEL in "${MODELS[@]}"; do
  echo "=== Testing: $MODEL ==="
  RESPONSE=$(curl -s -X POST https://featherless.kim8.s4s.host/api/chat \
    -H "Content-Type: application/json" \
    -d "{\"model\":\"$MODEL\",\"messages\":[{\"role\":\"user\",\"content\":\"$PROMPT\"}]}")
  echo "$RESPONSE" | jq -r '.data.content // .error'
  echo ""
done

Error Handling

All errors follow a consistent format:

{"success": false, "error": "Error description here"}
HTTP CodeMeaning
400Invalid request (bad params, missing fields)
403Direct access denied (for included files)
404Route not found
502Upstream API error (Featherless API issue)