Skip to main content
POST
/
v3
/
universal-ai
Universal Ai
curl --request POST \
  --url https://api.edenai.run/v3/universal-ai \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "input": {},
  "provider_params": {},
  "show_original_response": false
}
'
{
  "status": "success",
  "cost": "<string>",
  "provider": "<string>",
  "feature": "<string>",
  "subfeature": "<string>",
  "output": "<unknown>",
  "error": {},
  "original_response": "<unknown>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Universal AI request body.

Model format: feature/subfeature/provider[/model]

Examples: - text/moderation/google - 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
string
required

Model in format: feature/subfeature/provider[/model]

Examples:

"text/moderation/google"

"ocr/ocr/amazon"

"image/generation/google/imagen-3"

input
Input · object
required

Feature-specific input parameters. Required fields depend on the feature/subfeature specified in provider. Examples:

  • text/moderation: {'text': 'content to moderate'}
  • 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'}
Examples:
{
"text": "Content to moderate for harmful material"
}
{
"dimensions": 512,
"texts": ["text1", "text2"]
}
{ "file_id": "abc123", "language": "en" }
provider_params
Provider Params · object

Provider-specific parameters

show_original_response
boolean | null
default:false

Include raw provider response in the output

Response

Successful Response

Normalized response from universal-ai endpoint.

All responses have a consistent structure regardless of the feature/subfeature.

status
enum<string>
required

Whether the request succeeded or failed

Available options:
success,
fail
cost
string
required

Cost in credits for this request

provider
string
required

Provider name that processed the request

feature
string
required

Feature category (e.g., text, ocr, image)

subfeature
string
required

Specific subfeature (e.g., ai_detection, sentiment)

output
any
required

Normalized output from the provider

error
Error · object

Error message from the provider (only present when status is 'fail')

original_response
any | null

Raw response from the provider (if show_original_response=true)