---
title: "Run a registered operation using a stored credential"
method: POST
path: "/v1/http/credential-request"
tags: ["Web"]
---

# Run a registered operation using a stored credential

`POST /v1/http/credential-request`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/v1/http/credential-request`
- Auth: HTTP bearer

Makes an authenticated outbound call using a credential this Mac holds,
without the caller ever receiving the material.

The body carries three ids and nothing else. The destination, method,
path, query and headers all come from the registered operation, so
there is no `url`, `method`, `headers`, `body`, `auth`, `allow_local`,
redirect or output-path field — unknown keys are refused rather than
ignored, including when null or false.

The response is a bounded projection: the operation id and known model
ids drawn from bundled constants. No upstream headers, body, final URL
or status text is relayed. An upstream 401 returns `upstream_rejected`
(502), which is NOT `credential_required` and deletes, refreshes and
retries nothing.

## Request body

- StoredCredentialRequestPayload
  - `storedCredential` StoredCredentialSelection, required: Three ids and nothing else. There is deliberately no url, method, header, body, account, value or reference field: the destination comes from the registered operation and the material from the stored role, so a caller cannot choose either. The ids are checked for AGREEMENT with the registered row and are never read as instructions.
    - `credentialId` string, required: Exact credential identity key (`host:api.cloudflare.com`). Must equal the registered row's.
    - `roleId` string, required: Exact catalog role id (`workers-ai`). A same-kind sibling is never substituted.
    - `operationId` string, required: The registered operation id. Exact match; an unknown id fails closed.

## Response `200`

The bounded operation result

- CredentialOperationResult: The entire success vocabulary. No headers, body, final URL, status text, timing or artifact path, because each of those is a channel an upstream writes into and this path carries an injected secret.
  - `operationId` string, required
  - `models` CredentialOperationModel[], required: Sorted, deduplicated intersection with the bundled ids. Empty is valid and is not the vendor's full catalog.
    - `id` string, required: A bundled Cloudflare template model id. Emitted from compiled constants, never upstream spelling.

## Other responses

- `400`: Invalid request
- `403`: Resolution succeeded and local authorization refused the use
- `409`: No material at that role, or it changed under the caller
- `502`: The call was sent and the service did not produce a usable answer
- `503`: Stored-credential operations not initialized, or the Keychain could not be read

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
