Skip to content
Get started

List AI provider keys

GET/v1/workspaces/{workspaceId}/ai_provider_keys

Lists all customer-provided AI provider keys in the workspace

Path ParametersExpand Collapse
workspaceId: string
Query ParametersExpand Collapse
cursor: optional string

Pagination cursor from previous response

includeInfo: optional boolean

When true, populate each item’s info (model counts), at the cost of extra lookups.

limit: optional number

Maximum number of results to return

formatint32
prefix: optional string

Filter expression (query param: prefix)

promotional: optional boolean

When true, return only promotional keys (provided by Cadenya, e.g. for onboarding). Defaults to returning all keys, customer-provided and promotional alike.

query: optional string

Free-form search query

sortOrder: optional string

Sort order for results (asc or desc by creation time)

ReturnsExpand Collapse
items: optional array of AIProviderKey { metadata, spec, info }
metadata: ResourceMetadata { id, accountId, createdAt, 7 more }

Standard metadata for persistent, named resources (e.g., agents, tools, prompts)

id: string

Unique identifier for the resource (prefixed ULID, e.g., “agent_01HXK…”)

accountId: string

Account this resource belongs to for multi-tenant isolation (prefixed ULID)

createdAt: string

Timestamp when this resource was created

formatdate-time
name: string

Human-readable name for the resource (e.g., “Customer Support Agent”, “Email Tool”) Required for resources that users interact with directly

profileId: string

ID of the actor (user or service account) that created this resource

workspaceId: string

Workspace this resource belongs to for organizational grouping (prefixed ULID)

bundleKey: optional string

Optional bundle ownership key. When set, indicates the resource is managed by a configuration bundle identified by this key. Used by BulkWorkspaceResources.Apply to track which resources belong to which bundle for reconciliation / soft-delete on re-apply.

externalId: optional string

External ID for the resource (e.g., a workflow ID from an external system)

labels: optional map[string]

Arbitrary key-value pairs for categorization and filtering Examples: {“environment”: “production”, “team”: “platform”, “version”: “v2”}

updatedAt: optional string

Timestamp when this resource was last updated

formatdate-time
spec: AIProviderKeySpec { apiKey, openrouter, provider }
apiKey: optional string

The provider credential. Accepted on create/update; never populated in responses (the server returns an empty value to avoid leaking it).

openrouter: optional unknown

OpenRouterConfig holds OpenRouter-specific settings. Empty for now; it exists as the oneof seam so provider-specific options (region, base URL, etc.) can be added later without restructuring the spec.

provider: optional "AI_PROVIDER_UNSPECIFIED" or "AI_PROVIDER_OPENROUTER"

The AI provider this key authenticates against.

formatenum
One of the following:
"AI_PROVIDER_UNSPECIFIED"
"AI_PROVIDER_OPENROUTER"
info: optional object { disabledModelCount, enabledModelCount, isPromotional }

AIProviderKeyInfo carries server-derived, read-only details about a key, for AI provider management UIs.

disabledModelCount: optional number

Number of disabled models provisioned on this key.

formatint32
enabledModelCount: optional number

Number of enabled models provisioned on this key.

formatint32
isPromotional: optional boolean

Cadenya includes promotional keys (one for onboarding, and potentially more in the future). These are not added or maintained by account administrators.

List AI provider keys

curl https://api.cadenya.com/v1/workspaces/$WORKSPACE_ID/ai_provider_keys \
    -H "Authorization: Bearer $CADENYA_API_KEY"
{
  "items": [
    {
      "metadata": {
        "id": "id",
        "accountId": "accountId",
        "createdAt": "2019-12-27T18:11:19.117Z",
        "name": "name",
        "profileId": "profileId",
        "workspaceId": "workspaceId",
        "bundleKey": "bundleKey",
        "externalId": "externalId",
        "labels": {
          "foo": "string"
        },
        "updatedAt": "2019-12-27T18:11:19.117Z"
      },
      "spec": {
        "apiKey": "apiKey",
        "openrouter": {},
        "provider": "AI_PROVIDER_UNSPECIFIED"
      },
      "info": {
        "disabledModelCount": 0,
        "enabledModelCount": 0,
        "isPromotional": true
      }
    }
  ],
  "pagination": {
    "nextCursor": "nextCursor",
    "total": 0
  }
}
Returns Examples
{
  "items": [
    {
      "metadata": {
        "id": "id",
        "accountId": "accountId",
        "createdAt": "2019-12-27T18:11:19.117Z",
        "name": "name",
        "profileId": "profileId",
        "workspaceId": "workspaceId",
        "bundleKey": "bundleKey",
        "externalId": "externalId",
        "labels": {
          "foo": "string"
        },
        "updatedAt": "2019-12-27T18:11:19.117Z"
      },
      "spec": {
        "apiKey": "apiKey",
        "openrouter": {},
        "provider": "AI_PROVIDER_UNSPECIFIED"
      },
      "info": {
        "disabledModelCount": 0,
        "enabledModelCount": 0,
        "isPromotional": true
      }
    }
  ],
  "pagination": {
    "nextCursor": "nextCursor",
    "total": 0
  }
}