Create the caller's API key
curl --request POST \
--url https://web-api.soxai.site/api-key/secret \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"apikey_expires": 30,
"apikey_created_at": "2026-01-01T00:00:00Z"
}
'import requests
url = "https://web-api.soxai.site/api-key/secret"
payload = {
"apikey_expires": 30,
"apikey_created_at": "2026-01-01T00:00:00Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({apikey_expires: 30, apikey_created_at: '2026-01-01T00:00:00Z'})
};
fetch('https://web-api.soxai.site/api-key/secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "API Key created successfully",
"API Key Info": {
"apikey_key": "<api key>",
"apikey_expires": 30,
"apikey_created_at": "2026-09-08T00:00:00+00:00"
}
}{
"error": "bad-request",
"error_msg": "Invalid input: <reason>"
}{
"error": "http-error",
"error_msg": "Invalid authentication credentials. <reason>"
}{
"error": "forbidden",
"error_msg": "Not enough permission"
}{
"error": "unprocessable-entity",
"error_msg": "body.<field>: <validation message>"
}{
"error": "rate-limited",
"error_msg": "Rate limit exceeded. Retry after <n> seconds."
}{
"error": "internal-server-error",
"error_msg": "Failed to fetch data: <error_message>"
}API Keys
Create the caller's API key
Issue an API key for the caller’s own account.
The key is generated by the server. Calling this again replaces the existing key, so a client still using the previous one stops working.
Parameters
- Body (
APIKeyInfo):apikey_expiresis required.apikey_keyis ignored and assigned by the server;apikey_created_atdefaults to now.
Response
200{"message", "API Key Info"}. The key is shown here and can be read back later atGET /api-key/secret.
Errors
- None specific to this endpoint. The statuses every endpoint can answer with are listed at the top of this page.
Authorization
- Scheme:
Authorization: Bearer <idToken>orsoxai-api-key: <api key>. - Any authenticated caller. The key is issued for the caller’s own account and for no other, so no role is required.
POST
/
api-key
/
secret
Create the caller's API key
curl --request POST \
--url https://web-api.soxai.site/api-key/secret \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"apikey_expires": 30,
"apikey_created_at": "2026-01-01T00:00:00Z"
}
'import requests
url = "https://web-api.soxai.site/api-key/secret"
payload = {
"apikey_expires": 30,
"apikey_created_at": "2026-01-01T00:00:00Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({apikey_expires: 30, apikey_created_at: '2026-01-01T00:00:00Z'})
};
fetch('https://web-api.soxai.site/api-key/secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "API Key created successfully",
"API Key Info": {
"apikey_key": "<api key>",
"apikey_expires": 30,
"apikey_created_at": "2026-09-08T00:00:00+00:00"
}
}{
"error": "bad-request",
"error_msg": "Invalid input: <reason>"
}{
"error": "http-error",
"error_msg": "Invalid authentication credentials. <reason>"
}{
"error": "forbidden",
"error_msg": "Not enough permission"
}{
"error": "unprocessable-entity",
"error_msg": "body.<field>: <validation message>"
}{
"error": "rate-limited",
"error_msg": "Rate limit exceeded. Retry after <n> seconds."
}{
"error": "internal-server-error",
"error_msg": "Failed to fetch data: <error_message>"
}Authorizations
HTTPBearerSoxaiApiKey
Body
application/json
Response
The key as issued. It can be read back later at GET /api-key/secret.