Smart Endpoints
SenseFlow Smart Endpoints are AI-powered API endpoints that return structured JSON data instead of conversational text. Unlike Agents, which are designed for back-and-forth conversation, Smart Endpoints are built for programmatic use. They are ideal for backend tasks, data extraction, content generation, and integrating AI-driven logic directly into your applications.
Use Cases
- Data extraction (OCR): Extract structured data from images like passports, invoices, or receipts.
- Content generation: Create product descriptions, marketing copy, or social media posts.
- Data analysis: Perform sentiment analysis on user reviews or classify support tickets.
- Function calling: Act as a natural language interface for your existing APIs, translating a prompt into a structured JSON payload.
Creating a Smart Endpoint
- Navigate to SenseFlow → Smart Endpoints and click + New.
- You can either configure the endpoint manually or use the Generate with AI feature by describing its purpose (e.g., "Create an endpoint that analyzes the sentiment of a product review and returns a score from -1 to 1").
Configuration Reference
This section provides a detailed breakdown of every field available when creating or editing a Smart Endpoint.
| Field | Description |
|---|---|
| Name | A unique, human-readable name for the endpoint (e.g., Passport OCR Extractor). |
| Description | A brief summary of what the endpoint does. This is for your team's reference. |
| Instructions | The system prompt that guides the AI's behavior. It should be very specific about the task and the desired output format. |
| Model | The underlying AI model that will power the endpoint. The choice affects performance, cost, and capabilities (e.g., multimodal reasoning for file uploads). |
| Expects file | A toggle that enables file uploads for this endpoint. When enabled, you can send a file along with your prompt. |
| Response schema | A crucial field to ensure reliable and consistent JSON output. You can define the structure as a plain JSON object or a formal OpenAPI Specification (OAS) schema. |
| Slug | A unique, URL-friendly identifier for the endpoint. If left blank, it will be generated from the name. This is used in the API call URL. |
Example: Passport OCR
Let's say we want to build an endpoint that extracts information from a passport image.
1. Instructions (system prompt)
Your Instructions would look something like this:
You will receive an image of a passport. Your task is to perform OCR to extract the following fields: first name, last name, passport number, nationality, date of birth, and expiration date. Validate the extracted data and return it in the specified JSON format.
2. JSON Schema Example
You can provide a simple JSON object to define the output structure.
{
"firstName": "John",
"lastName": "Doe",
"passportNumber": "L898902C",
"nationality": "USA",
"dateOfBirth": "1980-01-22",
"expirationDate": "2030-05-15"
}
3. OpenAPI Specification (OAS) 3.0 Example (JSON)
For more complex validation and type enforcement, you can use an OAS schema in JSON format.
An OpenAPI Schema provides stricter validation, enforces data types (e.g., date), and is better for generating client libraries and other automated tooling.
{
"type": "object",
"properties": {
"firstName": {
"type": "string",
"description": "The given name of the passport holder."
},
"lastName": {
"type": "string",
"description": "The surname of the passport holder."
},
"passportNumber": {
"type": "string",
"description": "The unique passport identification number."
},
"nationality": {
"type": "string",
"description": "The 3-letter country code for nationality (e.g., USA)."
},
"dateOfBirth": {
"type": "string",
"format": "date",
"description": "The birth date in YYYY-MM-DD format."
},
"expirationDate": {
"type": "string",
"format": "date",
"description": "The expiration date in YYYY-MM-DD format."
}
},
"required": [
"firstName",
"lastName",
"passportNumber",
"nationality",
"dateOfBirth",
"expirationDate"
]
}
Integration
You can call your Smart Endpoint via a simple HTTP POST request.
Example 1: Text-Based Request (Product Review Sentiment)
curl -X POST https://external.elaniin.com/api/teams/{teamId}/endpoints/product-review-sentiment/handle \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Analyze the sentiment of this review: The product is amazing, but the shipping was too slow."
}'
Example 2: File Upload Request (Passport OCR)
When the Expects File toggle is enabled, you must send the request as multipart/form-data.
curl -X POST https://external.elaniin.com/api/teams/{teamId}/endpoints/passport-ocr-extractor/handle \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file[]=@/path/to/your/passport.jpg" \
-F "prompt=Passport image:"
Enhancing Your Endpoint with AI
After creating an endpoint, you can use the Enhance with AI feature to iterate and improve it. Describe the changes you want in plain language, and the AI will refine the details for you.
Example prompts for enhancement:
- Add a
confidence_scorefield (a number from 0 to 1) to the response schema. - Update the instructions to specify that all dates must be returned in
MM/DD/YYYYformat. - Refine the description to be more concise.
File Attachments and Supported File Types
The supported file types depend on the model family you have selected for your smart endpoint.
| Model family | File type | Supported formats |
|---|---|---|
| OpenAI (GPT models) | Documents |
|
| Code |
| |
| Google (Gemini models) | Images |
|
| Audio |
| |
| Video |
| |
| Documents |
|