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"}
}
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)