Skip to content
ndStill is in development. These docs describe the v2 API as designed; the SDKs and the hosted MCP server are previews and not generally available.
Docs

Credentials API

Scoped ways to pay minted for one decision: single-use cards, agent tokens, checkout tokens, wallet permissions.

5 endpointsGenerated from the typed registry

Base URL https://api.ndstill.com/v2. Send Authorization: Bearer with a key, Ndstill-Version: 2026-11-01, and an Idempotency-Key on every POST. Conventions, scopes and errors are in the API overview and Errors and decline reasons. Examples come from the mock backend; the shapes are the TypeScript types in packages/api.

Create a credential#

POST/v2/credentials
Request body CredentialCreate
  • agent_idIdrequired
  • typestring enumrequired
    "card""provider_key""wallet_permission"
  • funding_source_idIdrequired

    One of the agent's funding sources; its connection issues the credential.

  • amount_limitMoney | null

    Cap on the credential. Required when issuing; optional when linking an existing key.

    Money: 2 fields
    • amountnumberrequired
    • assetAssetCoderequired
      "USD""USDC""EUR""GBP"
  • merchantstring | null

    Cards only: lock to one merchant.

  • provider_refstring | null

    Link this existing provider key (an Anthropic key id, apikey_…) instead of creating one.

Response CredentialCreated
  • idId
  • object"credential"
  • org_idId
  • created_atTimestamp
  • updated_atTimestampoptional
  • test_modebooleanoptional

    True for test-mode objects (simulations, sandbox).

  • agentRef

    Small reference used for denormalized names in lists (no N+1 lookups in tables).

    Ref: 2 fields
    • idId
    • namestring
  • typeCredentialType
    "card""network_token""provider_key""wallet_permission""spt""bank_instruction"
  • railRail
    "card""network_token""checkout_token""stablecoin""bank""ai""cloud"
  • funding_sourceRef

    Small reference used for denormalized names in lists (no N+1 lookups in tables).

    Ref: 2 fields
    • idId
    • namestring
  • connectionRef | null

    Small reference used for denormalized names in lists (no N+1 lookups in tables).

    Ref: 2 fields
    • idId
    • namestring
  • scopeobject
    5 fields
    • counterpartystringoptional
    • merchant_categorystringoptional
    • amountMoneyoptional

      An amount: integer minor units + asset.

      Money: 2 fields
      • amountnumber
      • assetAssetCode
        "USD""USDC""EUR""GBP"
    • expires_atTimestamp | nulloptional
    • usesnumber | nulloptional
  • statusstring enum
    "active""revoked""expired""frozen""used"
  • displaystring

    Display hint only, never a secret ("Visa ····4417", "sk-…a91f").

  • provider_refstring
  • minted_by_decision_idId | null
  • intent_idId | nulloptional

    The payment the minting decision was for (opens the payment drawer). Null for standing credentials.

  • revoked_atTimestamp | null
  • revoked_byobject | object | object | object | null
    One of 4 shapes
    • kind"user"
    • idId
    • namestring
    • kind"agent"
    • idId
    • namestring
    • kind"system"
    • idIdoptional
    • namestring
    • kind"api_key"
    • idId
    • namestring
  • secretCredentialSecret | nulloptional

    A credential's value, returned exactly once when the provider shows it only once (an OpenAI service-account key). ndStill doesn't keep it: copy it when it's shown.

    CredentialSecret: 2 fields
    • valuestring
    • shown_oncetrue
Errors
  • 400invalid_request

    A field is missing or invalid; fields names each one.

  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 409conflict

    The object changed or already exists, or the Idempotency-Key was reused with a different body.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X POST "https://api.ndstill.com/v2/credentials" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "agt_01KYW6M8REDTGCTQ2ZK0CMDADJ",
    "type": "card",
    "funding_source_id": "fs_01KHHYDEME7D9A5AA3XYHBJD5E"
  }'
Response 400
{
  "object": "error",
  "type": "invalid_request",
  "code": "invalid_request",
  "message": "Set a spending cap for the credential.",
  "request_id": "req_bbd2ec7cf818b04ffeb6",
  "fields": {
    "amount_limit": "More than zero."
  }
}

The mock answered this sample with an error; its message says why. Adjust the request in Try it below.

Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

List credentials#

GET/v2/credentials
Query parameters all optional
  • agent_idId
  • type"card" | "network_token" | "provider_key" | "wallet_permission" | "spt" | "bank_instruction" | CredentialType[]
    "card""network_token""provider_key""wallet_permission""spt""bank_instruction"
  • status"active" | "revoked" | "expired" | "frozen" | "used" | (enum)[]

    One status, or several (OR): live = active + frozen.

    "active""revoked""expired""frozen""used"
  • railstring enum
    "card""network_token""checkout_token""stablecoin""bank""ai""cloud"
  • cursorstring
  • limitnumber

    1–200, default 50.

  • qstring

    Free-text search over names, ids and descriptors.

  • sortstring

    Sort field, prefix "-" for descending ("-created_at" is the default).

  • created_gteTimestamp

    created_at >= (ISO).

  • created_lteTimestamp

    created_at <= (ISO).

Response list of Credential

Returns a list envelope: object "list", data[], has_more, next_cursor (pass it back as cursor) and total when cheap to count. Items:

  • idId
  • object"credential"
  • org_idId
  • created_atTimestamp
  • updated_atTimestampoptional
  • test_modebooleanoptional

    True for test-mode objects (simulations, sandbox).

  • agentRef

    Small reference used for denormalized names in lists (no N+1 lookups in tables).

    Ref: 2 fields
    • idId
    • namestring
  • typeCredentialType
    "card""network_token""provider_key""wallet_permission""spt""bank_instruction"
  • railRail
    "card""network_token""checkout_token""stablecoin""bank""ai""cloud"
  • funding_sourceRef

    Small reference used for denormalized names in lists (no N+1 lookups in tables).

    Ref: 2 fields
    • idId
    • namestring
  • connectionRef | null

    Small reference used for denormalized names in lists (no N+1 lookups in tables).

    Ref: 2 fields
    • idId
    • namestring
  • scopeobject
    5 fields
    • counterpartystringoptional
    • merchant_categorystringoptional
    • amountMoneyoptional

      An amount: integer minor units + asset.

      Money: 2 fields
      • amountnumber
      • assetAssetCode
        "USD""USDC""EUR""GBP"
    • expires_atTimestamp | nulloptional
    • usesnumber | nulloptional
  • statusstring enum
    "active""revoked""expired""frozen""used"
  • displaystring

    Display hint only, never a secret ("Visa ····4417", "sk-…a91f").

  • provider_refstring
  • minted_by_decision_idId | null
  • intent_idId | nulloptional

    The payment the minting decision was for (opens the payment drawer). Null for standing credentials.

  • revoked_atTimestamp | null
  • revoked_byobject | object | object | object | null
    One of 4 shapes
    • kind"user"
    • idId
    • namestring
    • kind"agent"
    • idId
    • namestring
    • kind"system"
    • idIdoptional
    • namestring
    • kind"api_key"
    • idId
    • namestring
Errors
  • 400invalid_request

    A query parameter is invalid.

  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X GET "https://api.ndstill.com/v2/credentials?limit=2" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "object": "list",
  "data": [
    {
      "id": "cred_01M82SXXCY694M5CCQY045RHR5",
      "object": "credential",
      "org_id": "org_A99F918124609C9DAAACB209D8",
      "created_at": "2026-11-22T23:37:13.374Z",
      "agent": {
        "id": "agt_01KXDDQW8E1C6TZK3WM65H12M6",
        "name": "Procurement bot"
      },
      "type": "spt",
      "rail": "checkout_token",
      "funding_source": {
        "id": "fs_01KYDY0EME2Z6Z4XWJ26K16XP9",
        "name": "Stripe (shared payment tokens)"
      },
      "connection": {
        "id": "con_01KYDY0EME95JX2WT7A57RQY01",
        "name": "Stripe shared payment tokens"
      },
      "scope": {
        "counterparty": "Amazon Business",
        "amount": {
          "amount": 22982,
          "asset": "USD"
        },
        "expires_at": "2026-11-23T00:37:11.374Z",
        "uses": 1
      },
      "status": "expired",
      "display": "SPT spt_…b0b11f",
      "provider_ref": "spt_03168f4d81224ea5",
      "minted_by_decision_id": "dec_01M82SXVG0T0Z94XV41ZKD0F9M",
      "revoked_at": null,
      "revoked_by": null,
      "intent_id": "pi_01M82SXVEE8Z52H4GCJVSAAQRB"
    },
    {
      "id": "cred_01M82SXXCYJP3AX81SS36S7SWD",
      "object": "credential",
      "org_id": "org_A99F918124609C9DAAACB209D8",
      "created_at": "2026-11-22T23:37:13.374Z",
      "agent": {
        "id": "agt_01KXDDQW8E1C6TZK3WM65H12M6",
        "name": "Procurement bot"
      },
      "type": "spt",
      "rail": "checkout_token",
      "funding_source": {
        "id": "fs_01KYDY0EME2Z6Z4XWJ26K16XP9",
        "name": "Stripe (shared payment tokens)"
      },
      "connection": {
        "id": "con_01KYDY0EME95JX2WT7A57RQY01",
        "name": "Stripe shared payment tokens"
      },
      "scope": {
        "counterparty": "Amazon Business",
        "amount": {
          "amount": 35700,
          "asset": "USD"
        },
        "expires_at": "2026-11-23T00:37:11.374Z",
        "uses": 1
      },
      "status": "used",
      "display": "SPT spt_…8ea0aa",
      "provider_ref": "spt_03168f4d81224ea5",
      "minted_by_decision_id": "dec_01M82SXVG0V4M1F5PN43NR6JSE",
      "revoked_at": null,
      "revoked_by": null,
      "intent_id": "pi_01M82SXVEENJ34VTC3VGPS95F2"
    }
  ],
  "has_more": true,
  "next_cursor": "Mg==",
  "total": 79
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Retrieve a credential#

GET/v2/credentials/{id}
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Response Credential

The same Credential object as List credentials.

Errors
  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 404not_found

    No object with that id in this org.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X GET "https://api.ndstill.com/v2/credentials/cred_01M82SXXCY694M5CCQY045RHR5" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "id": "cred_01M82SXXCY694M5CCQY045RHR5",
  "object": "credential",
  "org_id": "org_A99F918124609C9DAAACB209D8",
  "created_at": "2026-11-22T23:37:13.374Z",
  "agent": {
    "id": "agt_01KXDDQW8E1C6TZK3WM65H12M6",
    "name": "Procurement bot"
  },
  "type": "spt",
  "rail": "checkout_token",
  "funding_source": {
    "id": "fs_01KYDY0EME2Z6Z4XWJ26K16XP9",
    "name": "Stripe (shared payment tokens)"
  },
  "connection": {
    "id": "con_01KYDY0EME95JX2WT7A57RQY01",
    "name": "Stripe shared payment tokens"
  },
  "scope": {
    "counterparty": "Amazon Business",
    "amount": {
      "amount": 22982,
      "asset": "USD"
    },
    "expires_at": "2026-11-23T00:37:11.374Z",
    "uses": 1
  },
  "status": "expired",
  "display": "SPT spt_…b0b11f",
  "provider_ref": "spt_03168f4d81224ea5",
  "minted_by_decision_id": "dec_01M82SXVG0T0Z94XV41ZKD0F9M",
  "revoked_at": null,
  "revoked_by": null,
  "intent_id": "pi_01M82SXVEE8Z52H4GCJVSAAQRB"
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Revoke a credential#

POST/v2/credentials/{id}/revoke

Revoke one scoped credential (card, token, permission) immediately.

Path parameters
  • idIdrequired

    A prefixed ID from this org.

Request body JSON
  • reasonstringrequired
Response Credential

The same Credential object as List credentials.

Errors
  • 400invalid_request

    A field is missing or invalid; fields names each one.

  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 404not_found

    No object with that id in this org.

  • 409conflict

    The object changed or already exists, or the Idempotency-Key was reused with a different body.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X POST "https://api.ndstill.com/v2/credentials/cred_01M82XPRPWFRSW43N9QBSENQM7/revoke" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Checking the API from the docs"
  }'
Response 200
{
  "id": "cred_01M82XPRPWFRSW43N9QBSENQM7",
  "object": "credential",
  "org_id": "org_A99F918124609C9DAAACB209D8",
  "created_at": "2026-11-23T00:43:13.500Z",
  "agent": {
    "id": "agt_01KYW6M8REDTGCTQ2ZK0CMDADJ",
    "name": "Cloud cost guard"
  },
  "type": "network_token",
  "rail": "network_token",
  "funding_source": {
    "id": "fs_01KFYEF2ME7CHTSE5WKHECPTR7",
    "name": "Operating (ndStill account)"
  },
  "connection": null,
  "scope": {
    "counterparty": "Delta Air Lines",
    "amount": {
      "amount": 4200,
      "asset": "USD"
    },
    "expires_at": "2026-11-23T01:43:13.499Z",
    "uses": 1
  },
  "status": "revoked",
  "display": "Single-use Visa ····4105",
  "provider_ref": "cred_2fc326ef1ad66d09",
  "minted_by_decision_id": "dec_01M82XPRQ16YEJ7MHD6VHE179E",
  "revoked_at": "2026-11-23T00:43:13.544Z",
  "revoked_by": {
    "kind": "user",
    "id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
    "name": "You"
  },
  "updated_at": "2026-11-23T00:43:13.544Z"
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Revoke several credentials#

POST/v2/credentials/bulk-revoke
Request body BulkRevokeBody
  • credential_idsstring[]
  • agent_idId
  • reasonstringrequired
Response BulkRevokeResult
  • object"bulk_revoke"
  • revokednumber
  • failedobject[]
    2 fields
    • idId
    • messagestring
Errors
  • 400invalid_request

    A field is missing or invalid; fields names each one.

  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 409conflict

    The object changed or already exists, or the Idempotency-Key was reused with a different body.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X POST "https://api.ndstill.com/v2/credentials/bulk-revoke" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Checking the API from the docs"
  }'
Response 400
{
  "object": "error",
  "type": "invalid_request",
  "code": "invalid_request",
  "message": "Choose credentials or an agent.",
  "request_id": "req_03ffa7e3eec822c12dd4",
  "fields": {
    "credential_ids": "Required"
  }
}

The mock answered this sample with an error; its message says why. Adjust the request in Try it below.

Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.