curl -X PATCH "https://api.sitespeak.ai/v1/agency/clients/{client_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message_limit": 5000,
"reset_credits": true,
"response_token_limit": 500
}'
const response = await fetch(
'https://api.sitespeak.ai/v1/agency/clients/{client_id}',
{
method: 'PATCH',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
message_limit: 5000,
reset_credits: true,
response_token_limit: 500
})
}
);
const data = await response.json();
console.log(data);
Agency
Update Client Workspace
Updates a client workspace: name, limits, external reference, or a mid-cycle credit reset
PATCH
/
v1
/
agency
/
clients
/
{client_id}
curl -X PATCH "https://api.sitespeak.ai/v1/agency/clients/{client_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message_limit": 5000,
"reset_credits": true,
"response_token_limit": 500
}'
const response = await fetch(
'https://api.sitespeak.ai/v1/agency/clients/{client_id}',
{
method: 'PATCH',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
message_limit: 5000,
reset_credits: true,
response_token_limit: 500
})
}
);
const data = await response.json();
console.log(data);
Available on agency plans. The API token must belong to the agency owner.
Only the fields you send are changed. Common flows:
- Raise credits mid-cycle: send a higher
message_limit. The client keeps their usage and gains the difference. - Plan change with a credit reset: send the new
message_limittogether withreset_credits: true. The client’s usage counter restarts immediately, so their remaining credits become the full new limit, up to your agency plan’s remaining monthly credits. Nothing carries over. - Cap response length: send
response_token_limitto bound how long the client’s AI agents’ answers can be. The agents are instructed to write complete answers that fit the budget, with a hard token cut as the backstop. Enforcement is approximate: the model targets the limit and gets a small allowance to finish its last sentence, so treat the value as a strong target, not an exact cutoff. - Let a client use their own LLM keys: send
byok_enabled: true. Their workspace administrators can then add API keys in their portal. Messages still count against the client’s credits. See Client API Keys (BYOK).
Path Parameters
| Name | Type | Description |
|---|---|---|
| client_id* | String | The ID of the client workspace. |
Headers
| Name | Type | Description |
|---|---|---|
| Accept* | String | application/json |
| Authorization* | String | Bearer |
| Content-Type* | String | application/json |
| Idempotency-Key | String | Optional. When set, retrying with the same key and body returns the original response. |
Body Parameters
| Name | Type | Description |
|---|---|---|
| name | String | The client workspace name. |
| external_reference | String | Your own identifier for this client. Send null to clear it. |
| message_limit | Integer | Monthly message credit limit. Send null to remove the client-level limit. |
| source_limit | Integer | Source limit. Send null to remove the client-level limit. |
| chatbot_limit | Integer | Maximum number of AI agents. Send null to remove the client-level limit. |
| response_token_limit | Integer | Response length limit in tokens (50 to 10000), enforced approximately (see above). Applies to new answers within seconds. Send null to remove the limit. |
| byok_enabled | Boolean | When true, the client’s workspace administrators can add their own LLM API keys. Messages still count against the client’s credits. When switched back to false, stored keys stop serving. See Client API Keys (BYOK). |
| reset_credits | Boolean | When true, the client’s usage counter restarts now and their remaining credits become the full message_limit (or the existing limit when message_limit is omitted). Use for mid-cycle plan changes. |
curl -X PATCH "https://api.sitespeak.ai/v1/agency/clients/{client_id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message_limit": 5000,
"reset_credits": true,
"response_token_limit": 500
}'
const response = await fetch(
'https://api.sitespeak.ai/v1/agency/clients/{client_id}',
{
method: 'PATCH',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
message_limit: 5000,
reset_credits: true,
response_token_limit: 500
})
}
);
const data = await response.json();
console.log(data);
Response
Returns the updated client workspace. After a credit reset,credits_reset_at holds the reset time and usage.messages starts again from 0.
- 200 Success
- 403 Not an agency account
- 404 Not found
- 422 Validation error
{
"client": {
"id": "dfcee2e1-3ace-41c6-9803-fb2b7c7cdfc7",
"name": "Acme Inc",
"external_reference": "billing-account-1001",
"status": "active",
"pause_mode": null,
"paused_at": null,
"byok_enabled": false,
"limits": {
"chatbots": 2,
"sources": 50,
"messages": 5000,
"response_tokens": 500
},
"usage": {
"chatbots": 1,
"sources": 12,
"messages": 0
},
"messages_remaining": 5000,
"topup_credits_remaining": 0,
"credits_exhausted_at": null,
"credits_reset_at": "2026-07-22T19:32:46+00:00",
"created_at": "2026-07-22T19:31:40+00:00"
}
}
Returns when the API token does not belong to an agency account owner.
Returns when no client workspace with this ID exists in your agency.
Returns when a field is invalid.
Last modified on August 25, 2026