curl --request POST \
--url https://api.opper.ai/management/v1/projects/{uuid}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'import requests
url = "https://api.opper.ai/management/v1/projects/{uuid}/api-keys"
payload = { "name": "<string>" }
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({name: '<string>'})
};
fetch('https://api.opper.ai/management/v1/projects/{uuid}/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"allowed_ips": [
"<string>"
],
"id": 123,
"kind": "<string>",
"name": "<string>",
"prefix": "<string>",
"created_at": "2023-11-07T05:31:56Z"
},
"meta": {}
}{
"data": {
"allowed_ips": [
"<string>"
],
"id": 123,
"kind": "<string>",
"name": "<string>",
"prefix": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"key": "<string>"
},
"meta": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"error": "<string>",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Mint an API key
Mints a runtime API key for the project. The full key is returned only on initial creation when return_secret is not false; the user MCP tool defaults false. Optional allowed_ips restricts the key to those addresses. Each entry is an IP address or CIDR range (for example 203.0.113.7 or 198.51.100.0/24). Public addresses only, up to 100 entries, ranges no wider than /8 (IPv4) or /16 (IPv6). An empty list accepts calls from any IP. Calls from any other address get 403 with code ip_not_allowed. A change takes up to a minute to apply. Reuse idempotency_key with identical arguments after uncertain results. A replay returns existing metadata without a secret; changed arguments or a deleted key return 409. Requires the apikeys:write scope.
curl --request POST \
--url https://api.opper.ai/management/v1/projects/{uuid}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'import requests
url = "https://api.opper.ai/management/v1/projects/{uuid}/api-keys"
payload = { "name": "<string>" }
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({name: '<string>'})
};
fetch('https://api.opper.ai/management/v1/projects/{uuid}/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"allowed_ips": [
"<string>"
],
"id": 123,
"kind": "<string>",
"name": "<string>",
"prefix": "<string>",
"created_at": "2023-11-07T05:31:56Z"
},
"meta": {}
}{
"data": {
"allowed_ips": [
"<string>"
],
"id": 123,
"kind": "<string>",
"name": "<string>",
"prefix": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"key": "<string>"
},
"meta": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"error": "<string>",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Authorizations
Body
IP addresses or CIDR ranges the key accepts calls from (for example 203.0.113.7 or 198.51.100.0/24). Public addresses only; up to 100 entries; ranges no wider than /8 for IPv4 or /16 for IPv6. Empty accepts any IP. Calls from any other address get 403 ip_not_allowed. A change takes up to a minute to apply.
100