AI Services API Reference
This section provides detailed documentation for the AI Services API, allowing you to integrate advanced artificial intelligence capabilities into your applications. Explore the endpoints, parameters, and response formats to leverage features like natural language processing, computer vision, speech recognition, and more.
Core AI Services
Natural Language Processing (NLP)
The NLP API allows you to understand, interpret, and generate human language.
POST /nlp/analyze
Analyzes text to extract sentiment, key phrases, entities, and language.
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | The input text to analyze. |
| features | array[string] | No | List of features to extract (e.g., "sentiment", "keyPhrases", "entities", "language"). Defaults to all available features. |
Request Body Example:
{
"text": "I love this new AI service! It's incredibly powerful and easy to use.",
"features": ["sentiment", "keyPhrases"]
}
Response Example:
{
"sentiment": {
"score": 0.95,
"label": "positive"
},
"keyPhrases": ["AI service", "incredibly powerful", "easy to use"]
}
Computer Vision
The Computer Vision API enables you to analyze images to detect objects, faces, text, and more.
POST /vision/analyze
Analyzes an image to extract metadata and identify content.
| Parameter | Type | Required | Description |
|---|---|---|---|
| imageUrl | string | Yes | URL of the image to analyze. |
| features | array[string] | No | List of features to extract (e.g., "tags", "faces", "objects", "ocr"). Defaults to common features. |
Request Body Example:
{
"imageUrl": "https://example.com/images/sample.jpg",
"features": ["tags", "objects"]
}
Response Example:
{
"tags": ["dog", "animal", "pet", "park", "grass"],
"objects": [
{"name": "dog", "confidence": 0.98, "box": {"x": 100, "y": 50, "w": 150, "h": 200}},
{"name": "tree", "confidence": 0.85, "box": {"x": 20, "y": 10, "w": 80, "h": 150}}
]
}
Speech Recognition
The Speech API converts spoken audio into text.
POST /speech/recognize
Transcribes audio content into text.
| Parameter | Type | Required | Description |
|---|---|---|---|
| audioData | binary | Yes | The audio data to transcribe. |
| language | string | No | The language of the audio (e.g., "en-US", "es-ES"). Defaults to "en-US". |
Response Example:
{
"transcript": "Hello, how can I help you today?"
}
Advanced AI Capabilities
Machine Translation
Translate text between multiple languages seamlessly.
POST /translate
Translates text from a source language to a target language.
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | The text to translate. |
| targetLanguage | string | Yes | The ISO 639-1 code of the target language (e.g., "fr", "de"). |
| sourceLanguage | string | No | The ISO 639-1 code of the source language. If omitted, the API will attempt to detect it. |
Request Body Example:
{
"text": "Bonjour le monde",
"targetLanguage": "en",
"sourceLanguage": "fr"
}
Response Example:
{
"translatedText": "Hello world"
}
Custom AI Models
Train and deploy your own custom AI models for specialized tasks. Refer to the Machine Learning API for details on model training and deployment.