curl --request POST \
--url https://api.edenai.run/v3/universal-ai \
--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"
},
"provider_params": {},
"fallbacks": [
"<string>"
],
"show_original_response": false
}
'import requests
url = "https://api.edenai.run/v3/universal-ai"
payload = {
"model": "text/ai_detection/openai/gpt-4",
"input": { "text": "Analyze this text for AI detection" },
"provider_params": {},
"fallbacks": ["<string>"],
"show_original_response": False
}
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'},
provider_params: {},
fallbacks: ['<string>'],
show_original_response: false
})
};
fetch('https://api.edenai.run/v3/universal-ai', 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",
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'
],
'provider_params' => [
],
'fallbacks' => [
'<string>'
],
'show_original_response' => false
]),
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"
payload := strings.NewReader("{\n \"model\": \"text/ai_detection/openai/gpt-4\",\n \"input\": {\n \"text\": \"Analyze this text for AI detection\"\n },\n \"provider_params\": {},\n \"fallbacks\": [\n \"<string>\"\n ],\n \"show_original_response\": false\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")
.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 \"provider_params\": {},\n \"fallbacks\": [\n \"<string>\"\n ],\n \"show_original_response\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/universal-ai")
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 \"provider_params\": {},\n \"fallbacks\": [\n \"<string>\"\n ],\n \"show_original_response\": false\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"cost": "<string>",
"provider": "<string>",
"feature": "<string>",
"subfeature": "<string>",
"output": "<unknown>",
"error": {},
"original_response": "<unknown>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Universal Ai
Universal AI endpoint for synchronous non-LLM AI features.
Model format: feature/subfeature/provider[/model]
Supported features:
- text/ai_detection, text/moderation, etc.
- ocr/ocr, ocr/identity_parser, etc.
- image/generation, image/background_removal, etc.
For async features (e.g., audio/speech_to_text_async), use POST /v3/universal-ai/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)
- provider_params: Optional provider-specific parameters
- show_original_response: Include raw provider response (default: false)
Example:
{
"model": "text/ai_detection/openai/gpt-4",
"input": {"text": "Analyze this text"}
}
curl --request POST \
--url https://api.edenai.run/v3/universal-ai \
--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"
},
"provider_params": {},
"fallbacks": [
"<string>"
],
"show_original_response": false
}
'import requests
url = "https://api.edenai.run/v3/universal-ai"
payload = {
"model": "text/ai_detection/openai/gpt-4",
"input": { "text": "Analyze this text for AI detection" },
"provider_params": {},
"fallbacks": ["<string>"],
"show_original_response": False
}
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'},
provider_params: {},
fallbacks: ['<string>'],
show_original_response: false
})
};
fetch('https://api.edenai.run/v3/universal-ai', 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",
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'
],
'provider_params' => [
],
'fallbacks' => [
'<string>'
],
'show_original_response' => false
]),
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"
payload := strings.NewReader("{\n \"model\": \"text/ai_detection/openai/gpt-4\",\n \"input\": {\n \"text\": \"Analyze this text for AI detection\"\n },\n \"provider_params\": {},\n \"fallbacks\": [\n \"<string>\"\n ],\n \"show_original_response\": false\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")
.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 \"provider_params\": {},\n \"fallbacks\": [\n \"<string>\"\n ],\n \"show_original_response\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.edenai.run/v3/universal-ai")
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 \"provider_params\": {},\n \"fallbacks\": [\n \"<string>\"\n ],\n \"show_original_response\": false\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"cost": "<string>",
"provider": "<string>",
"feature": "<string>",
"subfeature": "<string>",
"output": "<unknown>",
"error": {},
"original_response": "<unknown>"
}{
"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 request body.
Model format: feature/subfeature/provider[/model]
Examples: - text/ai_detection/openai/gpt-4 - ocr/ocr/amazon - image/generation/google/imagen-3
The input dict contains feature-specific parameters that are
validated at runtime based on the parsed feature/subfeature.
Model in format: feature/subfeature/provider[/model]
"text/ai_detection/openai/gpt-4"
"ocr/ocr/amazon"
"image/generation/google/imagen-3"
Feature-specific input parameters. Required fields depend on the feature/subfeature specified in provider. Examples:
- text/ai_detection: {'text': 'content to analyze'}
- text/embeddings: {'texts': ['text1', 'text2']}
- ocr/ocr: {'file_id': 'abc123', 'language': 'en'}
- image/generation: {'text': 'prompt', 'resolution': '1024x1024'}
- translation/document_translation: {'file_id': 'abc123', 'target_language': 'fr'}
{
"text": "Analyze this text for AI detection"
}
{
"dimensions": 512,
"texts": ["text1", "text2"]
}
{ "file_id": "abc123", "language": "en" }
Provider-specific parameters
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
Response
Successful Response
Sync response from universal-ai endpoint.
Inherits all fields from base, with status restricted to success/fail.
Whether the request succeeded or failed
success, fail 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)
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)