curl --request POST \
--url http://localhost:3000/api/v1/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "OpenAI Production",
"provider": "openai",
"apiKey": "sk-...",
"credentialType": "api_key",
"baseUrl": null,
"proxy": false,
"isValid": true
}'
const response = await fetch('http://localhost:3000/api/v1/credentials', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "OpenAI Production",
provider: "openai",
apiKey: "sk-...",
credentialType: "api_key",
baseUrl: null,
proxy: false,
isValid: true
})
});
const data = await response.json();
import requests
url = "http://localhost:3000/api/v1/credentials"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"name": "OpenAI Production",
"provider": "openai",
"apiKey": "sk-...",
"credentialType": "api_key",
"baseUrl": None,
"proxy": False,
"isValid": True
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Credential created successfully",
"credentialId": "cred_123abc"
}
{
"success": false,
"message": "Valid credential for provider already exists"
}
{
"success": false,
"message": "Unauthorized"
}
Credentials
Create Credential
Creates a new credential for AI providers. For Ollama, it manages models within a single credential.
POST
/
api
/
credentials
curl --request POST \
--url http://localhost:3000/api/v1/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "OpenAI Production",
"provider": "openai",
"apiKey": "sk-...",
"credentialType": "api_key",
"baseUrl": null,
"proxy": false,
"isValid": true
}'
const response = await fetch('http://localhost:3000/api/v1/credentials', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "OpenAI Production",
provider: "openai",
apiKey: "sk-...",
credentialType: "api_key",
baseUrl: null,
proxy: false,
isValid: true
})
});
const data = await response.json();
import requests
url = "http://localhost:3000/api/v1/credentials"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"name": "OpenAI Production",
"provider": "openai",
"apiKey": "sk-...",
"credentialType": "api_key",
"baseUrl": None,
"proxy": False,
"isValid": True
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Credential created successfully",
"credentialId": "cred_123abc"
}
{
"success": false,
"message": "Valid credential for provider already exists"
}
{
"success": false,
"message": "Unauthorized"
}
Body Parameters
string
Credential name or model name for Ollama
string
required
Provider name (e.g., openai, anthropic, ollama)
string
required
API key for the provider
string
required
Type of credential
string | null
Optional base URL for the provider
object
Additional dynamic fields
boolean
Whether to use proxy
boolean
Validation status
Response
boolean
Indicates if the credential was created successfully
string
Success or error message
string
The ID of the newly created credential
curl --request POST \
--url http://localhost:3000/api/v1/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "OpenAI Production",
"provider": "openai",
"apiKey": "sk-...",
"credentialType": "api_key",
"baseUrl": null,
"proxy": false,
"isValid": true
}'
const response = await fetch('http://localhost:3000/api/v1/credentials', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: "OpenAI Production",
provider: "openai",
apiKey: "sk-...",
credentialType: "api_key",
baseUrl: null,
proxy: false,
isValid: true
})
});
const data = await response.json();
import requests
url = "http://localhost:3000/api/v1/credentials"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"name": "OpenAI Production",
"provider": "openai",
"apiKey": "sk-...",
"credentialType": "api_key",
"baseUrl": None,
"proxy": False,
"isValid": True
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
{
"success": true,
"message": "Credential created successfully",
"credentialId": "cred_123abc"
}
{
"success": false,
"message": "Valid credential for provider already exists"
}
{
"success": false,
"message": "Unauthorized"
}
Notes
- For Ollama provider, credentials manage models within a single credential
- The
namefield can represent the credential name or model name for Ollama - Ensure the API key is valid before creating the credential
- The system checks for existing valid credentials for the same provider

