HTTP API for testing models programmatically
https://featherless.kim8.s4s.host/api
All endpoints accept and return JSON. Use POST for mutations, GET for queries.
List all available API routes.
curl https://featherless.kim8.s4s.host/api/routes
Health check endpoint.
curl https://featherless.kim8.s4s.host/api/health
Returns all categories with model counts.
curl https://featherless.kim8.s4s.host/api/models
Search models by name (case-insensitive). Max 50 results.
curl "https://featherless.kim8.s4s.host/api/search?q=qwen"
Send a chat completion request to a model.
| Field | Type | Required | Description |
|---|---|---|---|
model | string | yes | Model ID (alphanumeric + / - _ ., max 200 chars) |
messages | array | yes | 1-10 message objects with role and content |
system_prompt | string | no | System prompt (prepended if no system message in array) |
temperature | float | no | 0.0 - 2.0, default 0.7 |
max_tokens | int | no | 1 - 32000, default 500 |
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
}'
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);
Send a vision/image analysis request. Model must be in the vision category.
| Field | Type | Required | Description |
|---|---|---|---|
model | string | yes | Must be a vision-capable model |
prompt | string | yes | Text prompt describing what to analyze |
image | string | yes | Image URL or base64 data URI |
image_type | string | no | "url" (default) or "base64" |
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"
}'
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"
}'
Extract text from an image via OCR. Uses a fixed prompt internally. Model must be vision-capable.
| Field | Type | Required | Description |
|---|---|---|---|
model | string | yes | Must be a vision-capable model |
image | string | yes | Image URL or base64 data URI |
image_type | string | no | "url" (default) or "base64" |
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"
}'
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);
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
All errors follow a consistent format:
| HTTP Code | Meaning |
|---|---|
| 400 | Invalid request (bad params, missing fields) |
| 403 | Direct access denied (for included files) |
| 404 | Route not found |
| 502 | Upstream API error (Featherless API issue) |