Author an HTTP driver (AIP-31)
Use when wrapping a third-party HTTP API as a conformant driver for
an AIP-14 TOOL contract. The skill produces a frontmatter-only
DRIVER.md when body_template + response_extract cover the
dispatch shape, OR a DRIVER.md + driver.ts when conditional
request shaping is needed.
Process
- Identity: pick
idending in-http, setname,description,version,kind: http,base_url. - Auth: pick the auth pattern.
bearer-header→default_headers.Authorization: "Bearer ${secrets.X}",auth.state.env: [X],expiry.detect: "http_status:401".key-query→ nodefault_headers, per-toolquery_template.key: "${secrets.X}".oauth→ declareauth.login.url,auth.refresh,requires_callback_url: true. Refresh logic indriver.ts.custom→ write the entry'slogin/refresh/parseResponse.
- Per-tool dispatch: for each TOOL ref, author
metadata.http:endpoint(relative to base_url)method(default POST)body_templatefor JSON request body; ORquery_templatefor GET-style; OR omit and passargs.inputverbatimresponse_extract(JSONPath-lite) when the contract output is nested in the response bodycost_override.cost_units_per_callin millicents
- Sandbox + region + policy:
network.egress: [<api-host>]region(US, EU, global)policy_tags(third-party-llm, third-party-api, gdpr-compliant)
- Health check (recommended):
health_check.method: http, http: { method: GET, url: "<status-or-models-endpoint>", expect_status: 200 }, every: "PT5M". - Validate against
HTTP.schema.jsonANDDRIVER.schema.json. - Wire:
loadProvider(...)in the host; the resolver picks per call.
Common mistakes
- Hardcoded secrets in
default_headers— always use${secrets.X}substitution; never literal values. - Wildcard
network.egress— be specific to the API's host(s). - Missing
idempotency_key_headerwhen the tool mutates external state — risks double-charges on retry. - Body templating for conditional fields — when fields depend on
input presence, use
driver.ts buildRequest()instead ofbody_template. - TLS skip — never. Hosts MUST validate certificates.