FEATHERLESS_API_KEYin.envor environment- Access to models (some are gated)
- Project setup:
pnpm install
First verify the model is deployed and reachable:
curl -s -X POST "https://api.featherless.ai/v1/chat/completions" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"model":"MODEL_ID","messages":[{"role":"user","content":"Hello"}],"max_tokens":20}' | head -50- 200 OK with response → model exists
- 500/404 → not deployed or no access
Test with a simple tool call request:
curl -s -X POST "https://api.featherless.ai/v1/chat/completions" \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MODEL_ID",
"messages": [{"role":"user","content":"Run: echo hello"}],
"tools": [{"type":"function","function":{"name":"bash","description":"Run bash","parameters":{"type":"object","properties":{"command":{"type":"string"}}},"required":["command"]}}],
"max_tokens": 150,
"temperature": 0.7
}' | python3 -c "import json,sys; d=json.load(sys.stdin); msg=d['choices'][0]['message']; print('tool_calls:', msg.get('tool_calls')); print('content:', msg.get('content','')[:200])"Check response:
tool_callsarray present → native format ✅- Content contains
<function>→ add toMODELS_NEED_TOOL_CALL_PARSING - Content contains `