Run Single Job
curl --request POST \
--url https://api.promptloop.com/v0/tasks/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"inputs": [
"<string>"
],
"task_version": 0
}
'import requests
url = "https://api.promptloop.com/v0/tasks/{id}"
payload = {
"inputs": ["<string>"],
"task_version": 0
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: ['<string>'], task_version: 0})
};
fetch('https://api.promptloop.com/v0/tasks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"data": {
"data_json": [
{}
],
"job_id": "<string>",
"error_detected": true
},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
}
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
}
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
}
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
}
}Tasks
Run Single Job
Runs a single job with the provided task and inputs and awaits the result. Tasks have a default timeout of 1 minute. For longer running tasks, consider using async batches instead.
POST
/
v0
/
tasks
/
{id}
Run Single Job
curl --request POST \
--url https://api.promptloop.com/v0/tasks/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"inputs": [
"<string>"
],
"task_version": 0
}
'import requests
url = "https://api.promptloop.com/v0/tasks/{id}"
payload = {
"inputs": ["<string>"],
"task_version": 0
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({inputs: ['<string>'], task_version: 0})
};
fetch('https://api.promptloop.com/v0/tasks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"data": {
"data_json": [
{}
],
"job_id": "<string>",
"error_detected": true
},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
}
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
}
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
}
}{
"status": "error",
"data": {},
"message": "<string>",
"error": {
"code": 123,
"details": "<string>"
}
}Authorizations
Path Parameters
Body
application/json
