curl --request POST \
--url https://api.peel.sh/v1/keys \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"access": "full",
"expires_in_days": 183,
"api_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', access: 'full', expires_in_days: 183, api_id: '<string>'})
};
fetch('https://api.peel.sh/v1/keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.peel.sh/v1/keys"
payload = {
"name": "<string>",
"access": "full",
"expires_in_days": 183,
"api_id": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"key": "<string>",
"api_key": {
"id": "<string>",
"name": "<string>",
"start": "<string>",
"access": "full",
"permissions": [
"<string>"
],
"api_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z"
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}Create an API key
The secret is in this answer only. access is full, run or read; expires_in_days is 1 to 365, or null for no expiry. api_id limits the key to one API on the account. That key may read that API and call it (call, batch, feedback, executions), read its runs and executions (GET /v1/runs, GET /v1/runs/, GET /v1/executions/, and input and cancel on an execution), and reach GET /v1/quota and marketplace discovery: the GET /public/marketplace routes, which take no key, and the MCP tools get_quota, list_marketplace_apis, get_marketplace_api, search_marketplace_endpoints, search_routes and describe_route. Changing that API (revise, rebuild, repair, rollback, archive, delete, publish, unpublish), marketplace calls and installs, and every other route answer 403 key_limited_to_api. Needs a full-access key; a key with more access than the caller’s answers 403 key_access_too_wide.
curl --request POST \
--url https://api.peel.sh/v1/keys \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"access": "full",
"expires_in_days": 183,
"api_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', access: 'full', expires_in_days: 183, api_id: '<string>'})
};
fetch('https://api.peel.sh/v1/keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.peel.sh/v1/keys"
payload = {
"name": "<string>",
"access": "full",
"expires_in_days": 183,
"api_id": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"key": "<string>",
"api_key": {
"id": "<string>",
"name": "<string>",
"start": "<string>",
"access": "full",
"permissions": [
"<string>"
],
"api_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z"
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"retry": "same_key",
"docs_url": "<string>",
"details": {}
}