curl --request POST \
--url https://api.edenai.run/v3/universal-ai/async \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "text/ai_detection/openai/gpt-4",
"input": {
"text": "Analyze this text for AI detection"
},
"tags": {
"client": "acme",
"project": "invoices"
},
"provider_params": {},
"fallbacks": [
"<string>"
],
"show_original_response": false,
"output_format": "full",
"webhook_receiver": "<string>",
"user_webhook_parameters": {}
}
'import requests
url = "https://api.edenai.run/v3/universal-ai/async"
payload = {
"model": "text/ai_detection/openai/gpt-4",
"input": { "text": "Analyze this text for AI detection" },
"tags": {
"client": "acme",
"project": "invoices"
},
"provider_params": {},
"fallbacks": ["<string>"],
"show_original_response": False,
"output_format": "full",
"webhook_receiver": "<string>",
"user_webhook_parameters": {}
}
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({
model: 'text/ai_detection/openai/gpt-4',
input: {text: 'Analyze this text for AI detection'},
tags: {client: 'acme', project: 'invoices'},
provider_params: {},
fallbacks: ['<string>'],
show_original_response: false,
output_format: 'full',
webhook_receiver: '<string>',
user_webhook_parameters: {}
})
};
fetch('https://api.edenai.run/v3/universal-ai/async', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.edenai.run/v3/universal-ai/async",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'text/ai_detection/openai/gpt-4',
'input' => [
'text' => 'Analyze this text for AI detection'
],
'tags' => [
'client' => 'acme',
'project' => 'invoices'
],
'provider_params' => [
],
'fallbacks' => [
'<string>'
],
'show_original_response' => false,
'output_format' => 'full',
'webhook_receiver' => '<string>',
'user_webhook_parameters' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.edenai.run/v3/universal-ai/async"
payload := strings.NewReader("{\n \"model\": \"text/ai_detection/openai/gpt-4\",\n \"input\": {\n \"text\": \"Analyze this text for AI detection\"\n },\n \"tags\": {\n \"client\": \"acme\",\n \"project\": \"invoices\"\n },\n \"provider_params\": {},\n \"fallbacks\": [\n \"<string>\"\n ],\n \"show_original_response\": false,\n \"output_format\": \"full\",\n \"webhook_receiver\": \"<string>\",\n \"user_webhook_parameters\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.edenai.run/v3/universal-ai/async")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"text/ai_detection/openai/gpt-4\",\n \"input\": {\n \"text\": \"Analyze this text for AI detection\"\n },\n \"tags\": {\n \"client\": \"acme\",\n \"project\": \"invoices\"\n },\n \"provider_params\": {},\n \"fallbacks\": [\n \"<string>\"\n ],\n \"show_original_response\": false,\n \"output_format\": \"full\",\n \"webhook_receiver\": \"<string>\",\n \"user_webhook_parameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/universal-ai/async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"text/ai_detection/openai/gpt-4\",\n \"input\": {\n \"text\": \"Analyze this text for AI detection\"\n },\n \"tags\": {\n \"client\": \"acme\",\n \"project\": \"invoices\"\n },\n \"provider_params\": {},\n \"fallbacks\": [\n \"<string>\"\n ],\n \"show_original_response\": false,\n \"output_format\": \"full\",\n \"webhook_receiver\": \"<string>\",\n \"user_webhook_parameters\": {}\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"cost": "<string>",
"provider": "<string>",
"feature": "<string>",
"subfeature": "<string>",
"public_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"output_format": "full",
"output": "<unknown>",
"error": {},
"original_response": "<unknown>",
"model": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Async Job
Create an async job for long-running AI operations.
Model format: feature/subfeature/provider[/model]
Supported async features:
- audio/speech_to_text_async
Request body:
- model: Model string in format feature/subfeature/provider[/model]
- input: Feature-specific input parameters
- fallbacks: Optional list of fallback provider strings (max 3)
- webhook_receiver: Optional URL to receive job completion notification
- user_webhook_parameters: Optional custom parameters for webhook payload
Returns 202 Accepted with job info for polling.
curl --request POST \
--url https://api.edenai.run/v3/universal-ai/async \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "text/ai_detection/openai/gpt-4",
"input": {
"text": "Analyze this text for AI detection"
},
"tags": {
"client": "acme",
"project": "invoices"
},
"provider_params": {},
"fallbacks": [
"<string>"
],
"show_original_response": false,
"output_format": "full",
"webhook_receiver": "<string>",
"user_webhook_parameters": {}
}
'import requests
url = "https://api.edenai.run/v3/universal-ai/async"
payload = {
"model": "text/ai_detection/openai/gpt-4",
"input": { "text": "Analyze this text for AI detection" },
"tags": {
"client": "acme",
"project": "invoices"
},
"provider_params": {},
"fallbacks": ["<string>"],
"show_original_response": False,
"output_format": "full",
"webhook_receiver": "<string>",
"user_webhook_parameters": {}
}
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({
model: 'text/ai_detection/openai/gpt-4',
input: {text: 'Analyze this text for AI detection'},
tags: {client: 'acme', project: 'invoices'},
provider_params: {},
fallbacks: ['<string>'],
show_original_response: false,
output_format: 'full',
webhook_receiver: '<string>',
user_webhook_parameters: {}
})
};
fetch('https://api.edenai.run/v3/universal-ai/async', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.edenai.run/v3/universal-ai/async",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'text/ai_detection/openai/gpt-4',
'input' => [
'text' => 'Analyze this text for AI detection'
],
'tags' => [
'client' => 'acme',
'project' => 'invoices'
],
'provider_params' => [
],
'fallbacks' => [
'<string>'
],
'show_original_response' => false,
'output_format' => 'full',
'webhook_receiver' => '<string>',
'user_webhook_parameters' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.edenai.run/v3/universal-ai/async"
payload := strings.NewReader("{\n \"model\": \"text/ai_detection/openai/gpt-4\",\n \"input\": {\n \"text\": \"Analyze this text for AI detection\"\n },\n \"tags\": {\n \"client\": \"acme\",\n \"project\": \"invoices\"\n },\n \"provider_params\": {},\n \"fallbacks\": [\n \"<string>\"\n ],\n \"show_original_response\": false,\n \"output_format\": \"full\",\n \"webhook_receiver\": \"<string>\",\n \"user_webhook_parameters\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.edenai.run/v3/universal-ai/async")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"text/ai_detection/openai/gpt-4\",\n \"input\": {\n \"text\": \"Analyze this text for AI detection\"\n },\n \"tags\": {\n \"client\": \"acme\",\n \"project\": \"invoices\"\n },\n \"provider_params\": {},\n \"fallbacks\": [\n \"<string>\"\n ],\n \"show_original_response\": false,\n \"output_format\": \"full\",\n \"webhook_receiver\": \"<string>\",\n \"user_webhook_parameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/universal-ai/async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"text/ai_detection/openai/gpt-4\",\n \"input\": {\n \"text\": \"Analyze this text for AI detection\"\n },\n \"tags\": {\n \"client\": \"acme\",\n \"project\": \"invoices\"\n },\n \"provider_params\": {},\n \"fallbacks\": [\n \"<string>\"\n ],\n \"show_original_response\": false,\n \"output_format\": \"full\",\n \"webhook_receiver\": \"<string>\",\n \"user_webhook_parameters\": {}\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"cost": "<string>",
"provider": "<string>",
"feature": "<string>",
"subfeature": "<string>",
"public_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"output_format": "full",
"output": "<unknown>",
"error": {},
"original_response": "<unknown>",
"model": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Universal AI async request body.
Extends UniversalAIBody with webhook parameters for async notifications.
Model in format: feature/subfeature/provider[/model]
"text/ai_detection/openai/gpt-4"
"ocr/ocr/amazon"
"image/generation/google/imagen-3"
Feature-specific input fields, nested here rather than at the top level of the body. The fields accepted for the feature/subfeature named in model are its input_schema, served by GET /v3/info/{feature}/{subfeature}. Examples:
- text/ai_detection: {'text': 'content to analyze'}
- ocr/ocr: {'file': '', 'language': 'en'}
- image/generation: {'text': 'prompt', 'resolution': '1024x1024'}
- translation/document_translation: {'file': '', 'target_language': 'fr'}
{
"text": "Analyze this text for AI detection"
}
{
"file": "https://example.com/invoice.pdf",
"language": "en"
}
{
"resolution": "1024x1024",
"text": "A lighthouse at dusk"
}
Up to 10 key/value labels recorded with this call, for filtering and grouping usage. Merged with the X-EdenAI-Tags header.
{ "client": "acme", "project": "invoices" }
Native parameters in the provider's own request format, forwarded to the provider alongside input. On some features each provider accepts only an allowlist of parameters, and any other returns 400.
Fallback providers to try if the primary provider fails, in order. Accepted formats:
- 'provider' or 'provider/model' (e.g. 'amazon', 'openai/gpt-4')
- full model id (e.g 'text/moderation/google', 'image/generation/minimax/image-01')
3Include raw provider response in the output
compact trims output for LLM and agent callers: base64-encoded media is dropped wherever it appears (the *_resource_url download link next to it stays), and so is dense position data such as per-word OCR boxes, table cell boxes and face landmarks; one box per detected item stays. Fields the output schema marks required may therefore be absent. original_response is not trimmed. full returns the output unchanged. The response echoes the format. Applies to this response only: an async job keeps its full output, so pass output_format=compact again when fetching it.
full, compact Webhook URL to receive job completion notification
1 - 2083Custom parameters to include in webhook payload
Response
Successful Response
Async response from universal-ai/async endpoint.
Inherits base fields and adds job-specific fields for tracking async operations. Used for both job creation (202 Accepted) and job detail (GET) responses.
Request status: success, fail, or processing (async only)
success, fail, processing Cost in credits for this request
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Provider name that processed the request
Feature category (e.g., text, ocr, image)
Specific subfeature (e.g., ai_detection, sentiment)
Job ID for polling status
Job creation timestamp
Whether output, the normalized output, is whole (full) or trimmed for LLM callers (compact); echoes the request parameter. Unrelated to original_response, the raw provider payload behind show_original_response.
full, compact Normalized output from the provider
Error details from the provider (only present when status is 'fail')
Raw response from the provider (if show_original_response=true)
Model name if specified in the request