const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
monthlyBudgetCents: 500000,
routingPolicy: {
providers: {only: ['<string>'], exclude: ['<string>'], order: ['<string>']},
allow_fallbacks: true,
require_parameters: true,
data_policy: 'default',
caching: 'auto',
max_cost_usd: 123
}
})
};
fetch('https://www.ninjachat.ai/api/v1/management/projects/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.ninjachat.ai/api/v1/management/projects/{id}"
payload = {
"name": "<string>",
"monthlyBudgetCents": 500000,
"routingPolicy": {
"providers": {
"only": ["<string>"],
"exclude": ["<string>"],
"order": ["<string>"]
},
"allow_fallbacks": True,
"require_parameters": True,
"data_policy": "default",
"caching": "auto",
"max_cost_usd": 123
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)curl --request PATCH \
--url https://www.ninjachat.ai/api/v1/management/projects/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"monthlyBudgetCents": 500000,
"routingPolicy": {
"providers": {
"only": [
"<string>"
],
"exclude": [
"<string>"
],
"order": [
"<string>"
]
},
"allow_fallbacks": true,
"require_parameters": true,
"data_policy": "default",
"caching": "auto",
"max_cost_usd": 123
}
}
'{}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}management.projects.update
Requires projects:write. Changing routing also requires routing:write. Budgets are integer USD cents. Responses are not cacheable. Keys/secrets are shown only at creation/rotation. Mutations do not support automatic retries: read current resource state after an ambiguous failure. Standard limits: 120 reads/minute and 30 writes/minute per account.
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
monthlyBudgetCents: 500000,
routingPolicy: {
providers: {only: ['<string>'], exclude: ['<string>'], order: ['<string>']},
allow_fallbacks: true,
require_parameters: true,
data_policy: 'default',
caching: 'auto',
max_cost_usd: 123
}
})
};
fetch('https://www.ninjachat.ai/api/v1/management/projects/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://www.ninjachat.ai/api/v1/management/projects/{id}"
payload = {
"name": "<string>",
"monthlyBudgetCents": 500000,
"routingPolicy": {
"providers": {
"only": ["<string>"],
"exclude": ["<string>"],
"order": ["<string>"]
},
"allow_fallbacks": True,
"require_parameters": True,
"data_policy": "default",
"caching": "auto",
"max_cost_usd": 123
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)curl --request PATCH \
--url https://www.ninjachat.ai/api/v1/management/projects/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"monthlyBudgetCents": 500000,
"routingPolicy": {
"providers": {
"only": [
"<string>"
],
"exclude": [
"<string>"
],
"order": [
"<string>"
]
},
"allow_fallbacks": true,
"require_parameters": true,
"data_policy": "default",
"caching": "auto",
"max_cost_usd": 123
}
}
'{}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>",
"param": "<string>"
}
}Authorizations
Account-scoped management credential created by the account owner after email verification. Inference keys cannot access these endpoints; management keys cannot run inference.
Path Parameters
^[a-fA-F0-9]{24}$Body
Response
Management operation result. Lists use a data array; key/project/audit lists include next_cursor (null at end). Key create/rotate returns key once plus data metadata. X-Audit-Status: pending means the operation succeeded but its completion audit append needs investigation using X-Request-ID.
The response is of type object.