Create Api Token Endpoint
curl --request POST \
--url https://api.agentpowers.ai/v1/auth/api-tokens \
--header 'Content-Type: application/json' \
--data '
{
"name": "Default"
}
'import requests
url = "https://api.agentpowers.ai/v1/auth/api-tokens"
payload = { "name": "Default" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Default'})
};
fetch('https://api.agentpowers.ai/v1/auth/api-tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"token": "<string>",
"name": "<string>",
"created_at": "<string>",
"expires_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}auth
Create Api Token Endpoint
Create a new API token. The full token is returned only once.
POST
/
v1
/
auth
/
api-tokens
Create Api Token Endpoint
curl --request POST \
--url https://api.agentpowers.ai/v1/auth/api-tokens \
--header 'Content-Type: application/json' \
--data '
{
"name": "Default"
}
'import requests
url = "https://api.agentpowers.ai/v1/auth/api-tokens"
payload = { "name": "Default" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Default'})
};
fetch('https://api.agentpowers.ai/v1/auth/api-tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"token": "<string>",
"name": "<string>",
"created_at": "<string>",
"expires_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Was this page helpful?