Skip to main content

Anthropic skills API

This page documents the 4 gateway endpoints tagged anthropic_skills in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.

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

Endpoints​

GET /v1/skills​

List skills

List the skills on the provider account behind a deployment, one page at a time. Any key that may call that deployment can list them, and nothing changes. When several provider accounts are set up, name the deployment with the model query parameter or the x-spanway-model header. With custom_llm_provider=spanway_proxy and a query, the Spanway-hosted skills the key can reach are ranked by how closely they match the query instead. Docs

Parameters:

NameInTypeRequiredDescription
limitqueryinteger or nullNo
after_idquerystring or nullNo
before_idquerystring or nullNo
custom_llm_providerquerystring or nullNo
queryquerystring or nullNoDescribe what you need in natural language to rank the skills you can access by semantic similarity over their title and description. Each result carries a search_score. Only supported for custom_llm_provider=spanway_pro
top_kqueryintegerNoWith query: the maximum number of ranked skills to return.
modelquerystringNoDeployment whose provider account holds the skill, when several accounts exist. The x-spanway-model header does the same.

Example request:

curl -X GET "http://localhost:4000/v1/skills" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200One page of skillsapplication/json ListSkillsResponse
400A query was sent for a provider that cannot rank skills, or ranking is not set upapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key may not call the deployment that holds the skillapplication/json ProxyError
404The provider account has no skill with that idapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
429The key or the provider account is over its rate limitapplication/json ProxyError
503The embedding model that ranks skills did not answerapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataarray of SkillYesThis page of skills
has_morebooleanNoWhether more skills follow this page
next_pagestring or nullNoThe token for the next page, if there is one

POST /v1/skills​

Create a skill on the provider account

Upload a skill, a folder of instructions and files a Claude model can load when a task needs it, to the provider account behind a deployment. Any key that may call that deployment can create skills, and each creation is written to the audit log. Send the files as multipart form fields. When several provider accounts are set up, name the deployment with the model form field, the model query parameter or the x-spanway-model header. The answer is the new skill with its id, display title and timestamps.

Before the skill is stored, the guardrails set for skill scanning read SKILL.md, every bundled file and the text form fields. A blocked file, or a file the gateway could not check while scanning fails closed, refuses the upload with 400 and the scan result is kept for admins. Docs

Parameters:

NameInTypeRequiredDescription
custom_llm_providerquerystring or nullNo
modelquerystringNoDeployment whose provider account holds the skill, when several accounts exist. The x-spanway-model header does the same.

Request body (multipart/form-data, object):

FieldTypeRequiredDescription
display_titlestringNoName shown to users and models
files[]array of stringYesThe skill folder, at least a SKILL.md, or one zip archive
modelstringNoDeployment whose provider account stores the skill

Example request:

curl -X POST "http://localhost:4000/v1/skills" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-F files[]="value"

Responses:

StatusDescriptionBody
200The new skillapplication/json Skill
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key may not call the deployment that holds the skillapplication/json ProxyError
404The provider account has no skill with that idapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
429The key or the provider account is over its rate limitapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
created_atstringYesWhen the skill was created, ISO 8601
descriptionstring or nullNoWhat the skill does, filled for Spanway-hosted skills only
display_titlestring or nullNoThe name shown to users and models
idstringYesThe skill's id on the provider account
latest_versionstring or nullNoThe id of the skill's newest version
search_scorenumber or nullNoHow closely the skill matches the list query, when one was sent
sourcestringYesWho made the skill, custom or anthropic
typestringNoAlways skill
updated_atstringYesWhen the skill last changed, ISO 8601

GET /v1/skills/{skill_id}​

Get a skill

Read one skill from the provider account behind a deployment. Any key that may call that deployment can read it, and nothing changes. When several provider accounts are set up, name the deployment with the model query parameter or the x-spanway-model header. Docs

Parameters:

NameInTypeRequiredDescription
skill_idpathstringYes
custom_llm_providerquerystring or nullNo
modelquerystringNoDeployment whose provider account holds the skill, when several accounts exist. The x-spanway-model header does the same.

Example request:

curl -X GET "http://localhost:4000/v1/skills/skill_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The skillapplication/json Skill
400The provider refused the request, for example a skill that still has versionsapplication/json ProxyError
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key may not call the deployment that holds the skillapplication/json ProxyError
404The provider account has no skill with that idapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
429The key or the provider account is over its rate limitapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
created_atstringYesWhen the skill was created, ISO 8601
descriptionstring or nullNoWhat the skill does, filled for Spanway-hosted skills only
display_titlestring or nullNoThe name shown to users and models
idstringYesThe skill's id on the provider account
latest_versionstring or nullNoThe id of the skill's newest version
search_scorenumber or nullNoHow closely the skill matches the list query, when one was sent
sourcestringYesWho made the skill, custom or anthropic
typestringNoAlways skill
updated_atstringYesWhen the skill last changed, ISO 8601

DELETE /v1/skills/{skill_id}​

Delete a skill

Delete a skill from the provider account behind a deployment. Any key that may call that deployment can delete it, and each deletion is written to the audit log. Anthropic refuses to delete a skill that still has versions, so delete its versions first. When several provider accounts are set up, name the deployment with the model query parameter or the x-spanway-model header. Docs

Parameters:

NameInTypeRequiredDescription
skill_idpathstringYes
custom_llm_providerquerystring or nullNo
modelquerystringNoDeployment whose provider account holds the skill, when several accounts exist. The x-spanway-model header does the same.

Example request:

curl -X DELETE "http://localhost:4000/v1/skills/skill_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The skill is goneapplication/json DeleteSkillResponse
400The provider refused the request, for example a skill that still has versionsapplication/json ProxyError
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The key may not call the deployment that holds the skillapplication/json ProxyError
404The provider account has no skill with that idapplication/json ProxyError
422Validation Errorapplication/json HTTPValidationError
429The key or the provider account is over its rate limitapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesThe id of the deleted skill
typestringNoAlways skill_deleted