Skip to main content

Skills

Skills are packaged instructions and resources that an agent loads to perform a task well, for example a SKILL.md that explains how your release notes are written. The gateway proxies the Anthropic skills API, so teams create, list and delete skills with their virtual keys and the provider credential stays on the gateway. It also serves an agent skills index that coding agents can discover, and it hosts a Claude Code plugin marketplace, which the Admin UI calls skills too. Skill operations are logged and attributed like other calls.

A real-world scenario​

A documentation team keeps a skill that teaches models how release notes are structured. They create it once through the gateway with their team key. Any Messages API request from the team can then load the skill by id. When the structure changes they upload the new folder as a new skill and delete the old one, and when the skill is retired they delete it. The team's plugin for Claude Code lives in the gateway's marketplace, and only that team's key can install it until the admin publishes it for everyone.

Create a skill on the provider account​

The Anthropic skills API is a beta, and the gateway adds the beta flag the provider needs, so your requests do not. Skills are stored with the provider account behind the deployment. When several Anthropic deployments exist, choose the account with the x-spanway-model header, the model query parameter or a model form field, so the skill is created under the right account.

  1. Write the skill folder, at least a SKILL.md, or zip it.

  2. Upload it with a key that may use an Anthropic deployment:

    curl -X POST "http://localhost:4000/v1/skills" \
    -H "Authorization: Bearer $SPANWAY_API_KEY" \
    -F "display_title=Release notes writer" \
    -F "files[]=@SKILL.md"

    Expected result:

    {"id": "skill_01JD4Q9K7X2M8N3P5R6T7V8W9Y", "type": "skill", "display_title": "Release notes writer", "source": "custom", "latest_version": "1", "created_at": "2026-11-21T09:12:00Z", "updated_at": "2026-11-21T09:12:00Z"}
  3. List the skills the key's account holds:

    curl "http://localhost:4000/v1/skills?limit=10" -H "Authorization: Bearer $SPANWAY_API_KEY"
    {"data": [{"id": "skill_01JD4Q9K7X2M8N3P5R6T7V8W9Y", "type": "skill", "display_title": "Release notes writer", "source": "custom", "latest_version": "1", "created_at": "2026-11-21T09:12:00Z", "updated_at": "2026-11-21T09:12:00Z"}], "has_more": false}
  4. Use it in a Messages API request through the container field with the skills beta header, which the gateway forwards. The model loads the skill's instructions and files when the task matches. See Anthropic Messages. GET /v1/skills/{skill_id} reads one skill and DELETE /v1/skills/{skill_id} removes it, answering {"id": "...", "type": "skill_deleted"}. The gateway has no route for skill versions. The provider refuses to delete a skill that still has versions, so delete its versions in the provider console first, then delete the skill through the gateway.

The Logs page shows each skill call with the key and the Anthropic deployment it was routed to. Skills follow the model access of the calling key, because they belong to a provider account tied to a deployment. The Admin UI does not list provider account skills, its Skills page manages the Claude Code plugin marketplace.

MethodPathSummary
GET/v1/skillsList skills
POST/v1/skillsCreate a skill on the provider account
GET/v1/skills/{skill_id}Get a skill
DELETE/v1/skills/{skill_id}Delete a skill
GET/.well-known/agent-skills/index.jsonList the skills agents can install from this gateway
GET/v1/skills/{skill_id}/archiveDownload one skill as a zip archive

Store a skill on the gateway​

A skill can also live in the gateway's own database instead of a provider account, so it works with any model, not only Claude, and it can be listed in the skills index below. Send custom_llm_provider=spanway_proxy:

curl -X POST "http://localhost:4000/v1/skills?custom_llm_provider=spanway_proxy" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-F "display_title=Release notes writer" \
-F "description=Drafts release notes from merged changes" \
-F "instructions=Group the changes by area and write one plain sentence per change." \
-F "files[]=@release-notes.zip"

Expected result: the new skill, with an id of the form spanway_skill_<uuid>, for example spanway_skill_3f6c1a2e-8d4b-4c1e-9a7f-2b5d6e8c0a11. A gateway-hosted skill belongs to the user, team or key that created it. Listing, reading and deleting with custom_llm_provider=spanway_proxy only show that owner's skills, and proxy admins see all of them. The skill's instructions and files are prompt content written by key holders, so the gateway treats them like prompts, see database tables.

Use a gateway skill in a request​

List the skill's id under container.skills, the same field the Anthropic API uses:

curl http://localhost:4000/v1/messages -H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "gpt-5.5", "max_tokens": 1024,
"container": {"skills": [{"type": "custom", "skill_id": "spanway_skill_3f6c1a2e-8d4b-4c1e-9a7f-2b5d6e8c0a11"}]},
"messages": [{"role": "user", "content": "Write the notes for this week"}]}'

Before the call, the gateway loads the skill, adds its instructions to the prompt and offers it to the model as a tool, which is what lets a model from any provider use it. Provider skill ids in the same list are passed on untouched. This step is always on and only acts on requests that name a spanway_skill_ id.

When the skill has files, the gateway also offers a code execution tool. If the model calls it, the gateway runs the model's code with the skill's files in a throwaway Docker container, feeds the output back and calls the model again, up to 10 rounds and 120 seconds per run of code, then returns the final answer with any files the code produced. This is how a skill with a script, such as a spreadsheet builder, works with models that have no code tool of their own. The trade-off is that model-written code runs on infrastructure you operate, so the gateway host needs access to a Docker engine and you should only store skills with files you trust. Without Docker, or on a build without the sandbox, the tool answers Skill code execution is not available on this gateway: its sandbox library is missing. or a code execution failure, and the model sees that error. Callers cannot switch code execution on themselves, it only runs for skills loaded from the gateway.

Find skills by meaning​

With spanway_settings.skill_search_embedding_model set to an embedding model, GET /v1/skills ranks the gateway-hosted skills the key can reach by how well they match a question:

curl "http://localhost:4000/v1/skills?custom_llm_provider=spanway_proxy&query=write%20release%20notes&top_k=5" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Expected result: up to top_k skills, best match first, each with a search_score between 0 and 1. top_k is 1 to 100. Each search makes one embedding call that is billed like any other. Unset, skill search is off and a query answers 400 skill_search_not_configured.

Skills index for agents​

GET /.well-known/agent-skills/index.json lists the skills stored on the gateway and GET /v1/skills/{skill_id}/archive serves a skill as a zip archive. Coding agents that support skill discovery point at the gateway to pick up the skills your organisation maintains.

The gateway also answers the same index at the older address /.well-known/skills/index.json, which is not listed in the API reference. Discovery clients send no credentials, so all three routes are anonymous: anyone who can reach the gateway can read every stored skill once the index is on. For that reason the index is off by default and both routes answer 404 until you turn it on in the config file.

spanway_settings:
public_skills_index: true
curl http://localhost:4000/.well-known/agent-skills/index.json
{"$schema": "https://schemas.agentskills.io/discovery/0.2.0/schema.json", "skills": [{"name": "release-notes", "type": "archive", "description": "Drafts release notes from merged changes", "url": "https://gateway.example.com/v1/skills/spanway_skill_3f6c1a2e-8d4b-4c1e-9a7f-2b5d6e8c0a11/archive", "digest": "sha256:9f2c4e7a1b3d5f6e8a0c2e4f6a8b0d2e4f6a8c0e2b4d6f8a0c2e4f6a8b0d2e4f"}]}

Skills whose upload is not a zip holding SKILL.md in a single top-level folder are left out of the index, and the gateway logs a warning naming the skill.

MCP clients do not need the public index. The gateway's /mcp endpoint serves each key's own gateway-hosted skills through the standard MCP skills/list and skills/get methods, see skills over MCP.

Keys with tool search turned on also get a skill_search virtual tool that finds skills by meaning, using the same skill_search_embedding_model. When search is not set up or the embedding call fails, the tool answers the model with an error result that says why, instead of an HTTP error.

Grant Claude Code plugins to a key or team​

object_permission.skills on a key or team grants Claude Code plugins. Enabled plugins are public and every key sees them. A disabled plugin is private, so only proxy admins and keys granted it by name see it in /claude-code/marketplace.json?key=sk-.... When both the key and its team list skills, the key sees only the plugins in both lists. When only one of them lists skills, that list applies.

  1. In the Admin UI, open Virtual Keys or Teams, edit the key or team, pick the plugin in the Skills picker, where draft plugins carry a "private" label, and save.

  2. Or with the API:

    curl -X POST http://localhost:4000/key/update \
    -H "Authorization: Bearer $SPANWAY_MASTER_KEY" -H "Content-Type: application/json" \
    -d '{"key": "sk-team-key", "object_permission": {"skills": ["release-notes-writer"]}}'
  3. The key's catalogue at /claude-code/marketplace.json?key=sk-team-key now lists the plugin, and claude plugin install release-notes-writer@spanway works for that key. See Claude Code plugin marketplace for registering plugins.

Providers​

The gateway's endpoint support matrix marks 2 provider integrations as supporting this endpoint:

Anthropic, Anthropic Text.

Errors​

StatusWhereMeaningFix
400 or 404 from the provider about the model/v1/skillsx-spanway-model, model or the key's default does not name an Anthropic deployment.Pass a deployment from model_list the key may use.
401 or 403/v1/skillsThe key may not use any Anthropic deployment.Grant a model, see virtual keys.
400 skill_scan_blockedPOST /v1/skillsA guardrail blocked SKILL.md, a bundled file or a form field, so the skill was not created. The code is in error.type.Remove what the message names, see skill scanning.
400 skill_scan_incompletePOST /v1/skillsA file could not be checked and skill scanning fails closed.Fix the file or the guardrail, see skill scanning.
400 skill_scan_unsupported/anthropic/v1/skills...A skill change through the Anthropic pass-through route that the gateway cannot scan, such as a PATCH or a JSON body.Use POST /v1/skills, or send multipart form data to /anthropic/v1/skills or /anthropic/v1/skills/{skill_id}/versions, see skill scanning.
422 from the providerPOST /v1/skillsThe upload is not a skill, for example no SKILL.md.Include a SKILL.md at the root of the folder or archive.
400 skill_search_unsupported_providerGET /v1/skills?query=A query was sent for a provider account, which cannot rank skills.Add custom_llm_provider=spanway_proxy to search gateway-hosted skills.
400 skill_search_not_configuredGET /v1/skills?query=skill_search_embedding_model is not set.Set it in spanway_settings, see the settings reference.
503 skill_search_unavailableGET /v1/skills?query=The embedding model behind skill search failed.Check the embedding deployment on Models + Endpoints. The skill_search tool reports the same failure to the model as an error result.
404 Not FoundThe index and archive routespublic_skills_index is off.Turn it on in spanway_settings if the skills may be public.
404 No installable skill archive for: <id>GET /v1/skills/{skill_id}/archiveThe skill does not exist, or its upload is not a zip with SKILL.md in one top-level folder.Re-upload the skill as such a zip.
Plugin missing from the marketplace/claude-code/marketplace.json?key=...The plugin is disabled and the key is not granted it, or the key and its team both list skills and the plugin is only in one list.Grant it on the key, see above.

Logs​

LevelLineMeaningAction
WARNINGSkillsInjectionHook: Skill '<id>' not found in Spanway DBA request named a gateway skill that does not exist or belongs to someone else, so it was skipped.Check the id and the owner of the skill.
WARNINGSkillsInjectionHook: Max iterations (10) reachedThe model kept asking to run code past the round limit, so the gateway stopped.Tighten the skill's instructions.
ERRORSkillsInjectionHook: Code execution failed: ...Running the model's code failed, for example Docker is not reachable.Check Docker access from the gateway host.
ERRORSkillsSandboxExecutor: the sandbox library is missing from this gateway buildThe build has no code sandbox.Use the published gateway image.
WARNINGA line naming a skill that is left out of the indexThe skill's upload is not a zip with SKILL.md in one top-level folder.Re-upload it as such a zip.

Audit​

Every upload is first checked by skill scanning, which writes its own row on Spanway_SkillScanTable, created when the skill was stored and blocked when it was refused. Creating a skill writes a created row on Spanway_SkillsTable with the new skill, and deleting one writes deleted with its id, title, source and version for a gateway-hosted skill, or its id for a provider skill. Skills page plugin changes are audited on Spanway_ClaudeCodePluginTable, see the Skills page.