Secret manages credentials Superserve attaches to outbound requests; Provider lists the built-in shortcuts. Python ships both sync (Secret, Provider) and async (AsyncSecret, AsyncProvider) variants with identical method names.
Import
SUPERSERVE_API_KEY from the environment by default; pass apiKey / api_key to override.
Factory methods
Secret.create
Create a secret. Provide either a provider shortcut or a custom auth config with hosts — they’re mutually exclusive.
| Option | Type | Description |
|---|---|---|
name | string | Required. Unique secret name. |
value | string | Required. The credential. Encrypted on the platform; never returned. |
provider | string | A built-in shortcut (see Provider.list). Mutually exclusive with auth / hosts. |
auth | SecretAuth | Custom auth config. Requires hosts. |
hosts | string[] | Upstream hosts the credential may authenticate. Required with auth. |
Secret.
Secret.get
Fetch an existing secret by name. Returns a Secret.
Secret.list
List all secrets for the team. Returns an array of SecretInfo.
Secret.deleteByName / Secret.delete_by_name
Delete a secret by name. Idempotent. Revokes the secret everywhere immediately — bound stand-in tokens stop working.
Methods on secret
rotate
Replace the value. Bound sandboxes keep their env var; the new value is used on subsequent requests. Returns the updated Secret.
getAudit / get_audit
Requests made with this secret, across all sandboxes, newest first. Returns an array of ProxyAuditEvent.
| Option | Type | Description |
|---|---|---|
limit | number | Max events to return. |
before | number | Cursor — return events older than this event id. |
status | "2xx" | "3xx" | "4xx" | "5xx" | "errors" | Filter by status class. |
getSandboxes / get_sandboxes
Sandboxes this secret is currently bound to. Returns an array of SecretSandboxBinding.
getInfo / get_info · delete
getInfo() re-fetches the latest SecretInfo; delete() removes this secret (idempotent).
Provider.list
List the built-in provider shortcuts. Returns an array of ProviderShortcut.
Types
SecretInfo
| Field | Type |
|---|---|
id | string |
name | string |
authType / auth_type | "bearer" | "basic" | "api-key" | "custom" | "per_host" |
authConfig / auth_config | Record<string, unknown> |
providerShortcut / provider_shortcut | string | undefined |
hosts | string[] |
createdAt / created_at | Date / datetime |
updatedAt / updated_at | Date / datetime |
lastUsedAt / last_used_at | Date | undefined |
ProviderShortcut
| Field | Type |
|---|---|
name | string — pass as provider to Secret.create |
display | string |
authType / auth_type | SecretAuthType |
hosts | string[] |
tokenShape / token_shape | string — e.g. "sk-ant-api03-..." |
ProxyAuditEvent
| Field | Type |
|---|---|
id | number |
ts | Date / datetime |
sandboxId / sandbox_id | string |
sandboxName / sandbox_name | string | undefined |
method · host · path | string |
status | number |
upstreamStatus / upstream_status | number | undefined |
latencyMs / latency_ms | number | undefined |
errorCode / error_code | string | undefined |
SecretSandboxBinding
| Field | Type |
|---|---|
sandboxId / sandbox_id | string |
sandboxName / sandbox_name | string |
envKey / env_key | string |
status | SandboxStatus |
NetworkEvent, NetworkLogPage), see Sandbox.getNetworkLog.