Filament/Capabilities

Capabilities.

Six things Filament does. Each one documented and code-ready.

01

Unified Router

POST /api/route

One endpoint routes to Claude, GPT-4o, or Gemini. Set model: "auto" and Filament picks based on prompt type. Pin a model explicitly when needed.

  • Auto-routing by prompt analysis
  • Auto fallback on provider failure
  • OpenAI-compatible response format
  • Returns filament.model_used, latency_ms, status
POST /api/route
{
  "prompt": "Explain RAG",
  "model": "auto",
  "system": "Be concise.",
  "session_id": "sess_abc"
}
02

Tool Wiring

POST /api/wire

Register any HTTP endpoint as a tool the model can call. Schema-validated. Auth headers encrypted at rest.

  • JSON Schema input validation
  • Auth header stored encrypted
  • Hot-reloadable — no redeploy needed
  • List tools via GET /api/wire
POST /api/wire
{
  "name": "get_weather",
  "endpoint": "https://api.weather.com/v1",
  "schema": {
    "type": "object",
    "properties": {
      "location": { "type": "string" }
    }
  }
}
03

Observability

GET /api/observe

Every request is traced. Tokens, latency, model used, status. Filter by session. Pull via API or view in dashboard.

  • 9 fields logged per trace
  • Filter by session_id
  • Paginated with limit + offset
  • Status: ok / fallback / error
GET /api/observe
GET /api/observe
  ?session_id=sess_abc
  &limit=50
  &offset=0
04

Hot-swap

PATCH /api/session/:id

Swap the active model for a running session without losing context or tool bindings.

  • Context preserved on swap
  • Tool bindings preserved
  • Takes effect on next request
  • Accepts: claude, gpt, gemini, auto
PATCH /api/session/:id
PATCH /api/session/sess_abc

{
  "model": "claude"
}
05

skill.md

GET /skill.md

Machine-readable capability spec served as plain text. Drop the URL into any agent for automatic skill discovery.

  • Content-Type: text/plain
  • YAML frontmatter + Markdown body
  • No auth required
  • Describes all endpoints + schemas
GET /skill.md
curl https://filament.works/skill.md

# Returns:
---
name: filament
version: 1.0.0
endpoint: https://filament.works/api
---
## capabilities
...
06

OpenAI Compatible

POST /api/route

Drop-in replacement. Change one URL in your existing OpenAI SDK code. Same response schema, same interface.

  • Works with openai Python + JS SDKs
  • Same choices[].message.content format
  • Extra metadata in filament.* field
  • Change base_url, keep everything else
POST /api/route
from openai import OpenAI

client = OpenAI(
  base_url="https://filament.works/api",
  api_key="fl-..."
)

Six capabilities. One API key.

Get API Key →