curl -X POST "https://api.danubeai.com/v1/credentials/store" \
-H "danube-api-key: YOUR_DANUBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"service_id": "svc_openai_001",
"credential_type": "bearer",
"credential_value": "sk-proj-abc123..."
}'
# Via MCP tool
result = await mcp.call_tool("store_credential", {
"service_id": "svc_openai_001",
"credential_type": "bearer",
"credential_value": "sk-proj-abc123..."
})
{
"success": true,
"service_id": "svc_openai_001",
"service_name": "OpenAI",
"credential_type": "bearer"
}
Credentials
Store Credential
Store an API key or bearer token for a service
POST
/
v1
/
credentials
/
store
curl -X POST "https://api.danubeai.com/v1/credentials/store" \
-H "danube-api-key: YOUR_DANUBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"service_id": "svc_openai_001",
"credential_type": "bearer",
"credential_value": "sk-proj-abc123..."
}'
# Via MCP tool
result = await mcp.call_tool("store_credential", {
"service_id": "svc_openai_001",
"credential_type": "bearer",
"credential_value": "sk-proj-abc123..."
})
{
"success": true,
"service_id": "svc_openai_001",
"service_name": "OpenAI",
"credential_type": "bearer"
}
Overview
Stores a credential (API key or bearer token) for a service so that Danube can authenticate tool executions on your behalf. This is the agent-friendly credential storage endpoint — designed for programmatic use from SDKs and MCP clients. For OAuth credentials, use the dashboard OAuth flow instead. Auth: Requires API key (danube-api-key header).
Body Parameters
string
required
UUID of the service to store credentials for
string
required
Type of credential:
bearer or api_keystring
required
The credential itself (API key or bearer token), or a reference resolved where the tool runs:
env://VAR_NAME or vault://path. A reference is stored as text and the secret never reaches Danube. A self-hosted deployment accepts references only and rejects a plaintext value with 400.Response
boolean
Whether the credential was stored successfully
string
The service the credential is for
string
Human-readable service name
string
The type that was stored
string
reference when an env:// or vault:// value was sent, otherwise valueboolean
Present and true when a plaintext value was stored on the hosted service; references are the recommended form
string
Present with
deprecated: what to do insteadExample
curl -X POST "https://api.danubeai.com/v1/credentials/store" \
-H "danube-api-key: YOUR_DANUBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"service_id": "svc_openai_001",
"credential_type": "bearer",
"credential_value": "sk-proj-abc123..."
}'
# Via MCP tool
result = await mcp.call_tool("store_credential", {
"service_id": "svc_openai_001",
"credential_type": "bearer",
"credential_value": "sk-proj-abc123..."
})
{
"success": true,
"service_id": "svc_openai_001",
"service_name": "OpenAI",
"credential_type": "bearer"
}
MCP Tool
This endpoint is also available as thestore_credential MCP tool:
result = await mcp.call_tool("store_credential", {
"service_id": "svc_openai_001",
"credential_type": "bearer",
"credential_value": "sk-proj-abc123..."
})
Notes
- Credentials are encrypted at rest using AES-256
- Only
bearerandapi_keytypes are supported via this endpoint - For OAuth, use the dashboard credential flow at
/dashboard/tools/:serviceId - Storing a new credential for the same service replaces the existing one
