Skills Integration Guide

Schema bundles, multi-skill requests, and tool injection

Create a schema bundle

A schema bundle is a reusable set of tool definitions stored server-side. Create one via the management API, then reference it by ID in any request.

curl
curl -X POST https://api.therouter.ai/v1/customer/skills \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "crm-tools",
    "class": "schema_bundle",
    "tools": [{
      "type": "function",
      "function": {
        "name": "lookup_contact",
        "description": "Find a CRM contact by email or name",
        "parameters": {
          "type": "object",
          "properties": { "query": { "type": "string" } },
          "required": ["query"]
        }
      }
    }]
  }'

Reference skills in requests

Combine built-in skills with your own bundles. Each skill's tools merge into the final tool set sent to the model.

multi-skill-request.json
{
  "model": "openai/gpt-4.1",
  "messages": [{ "role": "user", "content": "Look up John Smith and search for pricing." }],
  "skills": [{ "id": "web" }, { "id": "sk_abc123" }]
}

How tool injection works

TheRouter resolves each skill's tool definitions and merges them with any tools already in the request body. The model sees one unified tool list. Duplicate function names are rejected with a 400 error.

tools-plus-skills.json
{
  "model": "anthropic/claude-sonnet-4.5",
  "messages": [{ "role": "user", "content": "Check inventory and search for pricing." }],
  "tools": [{ "type": "function", "function": { "name": "check_inventory",
    "parameters": { "type": "object", "properties": { "sku": { "type": "string" } }, "required": ["sku"] }
  }}],
  "skills": [{ "id": "web" }]
}
TheRouter extension
The skills field is a TheRouter extension on /v1/chat/completions and /v1/responses. Requests without it behave exactly like standard OpenAI API calls.