Examples
Real responses, route by route
Ten requests to the Serenity Edge API with their responses as they arrived: a summary, two documents compared from their images, an invoice read, a tool call, an answer that follows a JSON schema, a reply through the Responses API, a ticket triaged, sentences compared, results ranked and personal data masked. Each one links to its API reference and its guide, and copies as a cURL command.
Real API responses, generated on 14 October 2026, and on 14 November 2026 for image input, tool calling, structured outputs and the Responses API. This page makes no live calls.
When you create a Serenity Star account you get a welcome credit to try the chat models.
The decision, embeddings, rerank and redaction routes need a Serenity Edge API key.How to get one
Chat: summarising an email
Orion Plus summarises a customer email in three points, with a system message that sets the language and tone.
- Route
POST /v1/chat/completions- Model
orion-plus- Tokens
- 81 input and 66 output
Show the cURL command
Put your key in the SERENITY_EDGE_API_KEY environment variable first.
curl https://api.serenityedge.ai/v1/chat/completions \
-H "Authorization: Bearer $SERENITY_EDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "orion-plus",
"messages": [
{
"role": "system",
"content": "Reply in English, briefly and professionally."
},
{
"role": "user",
"content": "Summarise this email in three bullet points: '\''Hi, order 8812 arrived with two damaged boxes. I need replacements before Friday because we have a trade fair on Saturday. If that is not possible, I would rather have a refund for those two boxes.'\''"
}
],
"max_tokens": 200,
"temperature": 0.3
}'Request
{
"model": "orion-plus",
"messages": [
{
"role": "system",
"content": "Reply in English, briefly and professionally."
},
{
"role": "user",
"content": "Summarise this email in three bullet points: 'Hi, order 8812 arrived with two damaged boxes. I need replacements before Friday because we have a trade fair on Saturday. If that is not possible, I would rather have a refund for those two boxes.'"
}
],
"max_tokens": 200,
"temperature": 0.3
}Response
- Issue: Order 8812 arrived with two damaged boxes.
- Request: Urgent replacement of the damaged items is required before Friday to meet a Saturday trade fair deadline.
- Alternative: If replacements cannot be delivered by Friday, a refund for the two boxes is requested.
Images: two documents compared
Orion Plus receives two images in one message, a purchase order and the invoice that bills it, and lists the lines where they differ. Each image is an image_url part with a base64 data URL; how many images a request may carry depends on the model, as the guide says.
- Route
POST /v1/chat/completions- Model
orion-plus- Capability
- Image input(read from the API)
- Tokens
- 2,238 input and 61 output
Show the cURL command
Put your key in the SERENITY_EDGE_API_KEY environment variable first. The images are placeholders: replace each one with the data URL of your PNG.
curl https://api.serenityedge.ai/v1/chat/completions \
-H "Authorization: Bearer $SERENITY_EDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "orion-plus",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Image 1 is our purchase order and image 2 is the supplier'\''s invoice. List every line where they differ, with the quantities and amounts of both. Answer in English, briefly."
},
{
"type": "image_url",
"image_url": {
"url": "<data URL of your PNG image>"
}
},
{
"type": "image_url",
"image_url": {
"url": "<data URL of your PNG image>"
}
}
]
}
],
"max_tokens": 300,
"temperature": 0
}'Request


{
"model": "orion-plus",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Image 1 is our purchase order and image 2 is the supplier's invoice. List every line where they differ, with the quantities and amounts of both. Answer in English, briefly."
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,…"
}
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,…"
}
}
]
}
],
"max_tokens": 300,
"temperature": 0
}The base64 images are omitted from the request.
Response
The only differing line is Filter replacement:
- Purchase Order: Qty 4, Amount 98.00
- Invoice: Qty 6, Amount 147.00
All other lines (Preventive maintenance, Call-out fee) match exactly.
The response as JSON, recorded on 14 November 2026, without its id and timestamps
{
"object": "chat.completion",
"model": "orion-plus",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The only differing line is **Filter replacement**:\n\n- **Purchase Order**: Qty 4, Amount 98.00 \n- **Invoice**: Qty 6, Amount 147.00 \n\nAll other lines (Preventive maintenance, Call-out fee) match exactly."
},
"finish_reason": "stop"
}
],
"usage": {
"completion_tokens": 61,
"prompt_tokens": 2238,
"total_tokens": 2299,
"completion_tokens_details": {
"reasoning_tokens": 0
},
"prompt_tokens_details": {
"cached_tokens": 0
}
}
}OCR: reading an invoice
PaddleOCR-VL 1.6 receives the image of an invoice with the task prompt “OCR:” and returns its text, keeping the layout of the table.
- Route
POST /v1/chat/completions- Model
paddleocr-vl-1.6- Tokens
- 1,243 input and 178 output
Show the cURL command
Put your key in the SERENITY_EDGE_API_KEY environment variable first. The images are placeholders: replace each one with the data URL of your PNG.
curl https://api.serenityedge.ai/v1/chat/completions \
-H "Authorization: Bearer $SERENITY_EDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "paddleocr-vl-1.6",
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "<data URL of your PNG image>"
}
},
{
"type": "text",
"text": "OCR:"
}
]
}
],
"max_tokens": 1024
}'Request

{
"model": "paddleocr-vl-1.6",
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,…"
}
},
{
"type": "text",
"text": "OCR:"
}
]
}
],
"max_tokens": 1024
}The base64 image is omitted from the request.
Response
INVOICE No. 2026-0418
Date: 14/10/2026 Due: 13/11/2026
Customer: Talleres Ribera, S.L. VAT ID ESB12345678
Description Qty Price Amount
Preventive maintenance 2 180.00 360.00
Filter replacement 6 24.50 147.00
Call-out fee 1 45.00 45.00
Subtotal 552.00
VAT 21 % 115.92
TOTAL (EUR) 667.92
Tool calling: looking up an order
Orion Pro has a function to look up orders. Instead of guessing, it answers with a call to that function and its arguments; your application runs it and sends the result back.
- Route
POST /v1/chat/completions- Model
orion-pro- Capability
- Tools(read from the API)
- Tokens
- 330 input and 31 output
Show the cURL command
Put your key in the SERENITY_EDGE_API_KEY environment variable first.
curl https://api.serenityedge.ai/v1/chat/completions \
-H "Authorization: Bearer $SERENITY_EDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "orion-pro",
"messages": [
{
"role": "system",
"content": "You are the support assistant of an online shop. Look orders up with the tools; never guess."
},
{
"role": "user",
"content": "Where is my order 8812? It should have arrived yesterday."
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_order_status",
"description": "Status and tracking of an order by its number.",
"strict": true,
"parameters": {
"type": "object",
"properties": {
"order_id": {
"type": "string",
"description": "Order number"
}
},
"required": [
"order_id"
],
"additionalProperties": false
}
}
}
],
"tool_choice": "auto"
}'Request
{
"model": "orion-pro",
"messages": [
{
"role": "system",
"content": "You are the support assistant of an online shop. Look orders up with the tools; never guess."
},
{
"role": "user",
"content": "Where is my order 8812? It should have arrived yesterday."
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_order_status",
"description": "Status and tracking of an order by its number.",
"strict": true,
"parameters": {
"type": "object",
"properties": {
"order_id": {
"type": "string",
"description": "Order number"
}
},
"required": [
"order_id"
],
"additionalProperties": false
}
}
}
],
"tool_choice": "auto"
}Response
- Function to call
get_order_status- Arguments
order_id: "8812"
finish_reason: "tool_calls". Your application runs the function, adds a tool message with its result and sends the conversation again; the model then answers with it. How to send the result back
The response as JSON, recorded on 14 November 2026, without its id and timestamps
{
"object": "chat.completion",
"model": "orion-pro",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "chatcmpl-tool-94b669cf0c4b00ac",
"type": "function",
"function": {
"name": "get_order_status",
"arguments": "{\"order_id\": \"8812\"}"
}
}
]
},
"finish_reason": "tool_calls"
}
],
"usage": {
"completion_tokens": 31,
"prompt_tokens": 330,
"total_tokens": 361,
"completion_tokens_details": {
"reasoning_tokens": 0
},
"prompt_tokens_details": {
"cached_tokens": 0
}
}
}Structured outputs: a claim as JSON
Orion Plus turns a customer email into a JSON object that follows the schema of the request, ready for your code to read without parsing free text.
- Route
POST /v1/chat/completions- Model
orion-plus- Capability
- Structured outputs(read from the API)
- Tokens
- 128 input and 54 output
Show the cURL command
Put your key in the SERENITY_EDGE_API_KEY environment variable first.
curl https://api.serenityedge.ai/v1/chat/completions \
-H "Authorization: Bearer $SERENITY_EDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "orion-plus",
"messages": [
{
"role": "system",
"content": "Extract the claim from the customer'\''s email. Fields: order_id is the order number; damaged_boxes is how many boxes arrived damaged; request is what the customer asks for first; fallback is what they accept if that is not possible (\"none\" if they do not say); deadline is when they need it by, or null."
},
{
"role": "user",
"content": "Hi, order 8812 arrived with two damaged boxes. I need replacements before Friday because we have a trade fair on Saturday. If that is not possible, I would rather have a refund for those two boxes."
}
],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "claim",
"strict": true,
"schema": {
"type": "object",
"properties": {
"order_id": {
"description": "Order number.",
"type": "string"
},
"damaged_boxes": {
"description": "How many boxes arrived damaged.",
"type": "integer"
},
"request": {
"description": "What the customer asks for first.",
"type": "string",
"enum": [
"replacement",
"refund"
]
},
"fallback": {
"description": "What the customer accepts if the request is not possible.",
"type": "string",
"enum": [
"replacement",
"refund",
"none"
]
},
"deadline": {
"description": "When the customer needs it by, or null.",
"type": [
"string",
"null"
]
}
},
"required": [
"order_id",
"damaged_boxes",
"request",
"fallback",
"deadline"
],
"additionalProperties": false
}
}
}
}'Request
{
"model": "orion-plus",
"messages": [
{
"role": "system",
"content": "Extract the claim from the customer's email. Fields: order_id is the order number; damaged_boxes is how many boxes arrived damaged; request is what the customer asks for first; fallback is what they accept if that is not possible (\"none\" if they do not say); deadline is when they need it by, or null."
},
{
"role": "user",
"content": "Hi, order 8812 arrived with two damaged boxes. I need replacements before Friday because we have a trade fair on Saturday. If that is not possible, I would rather have a refund for those two boxes."
}
],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "claim",
"strict": true,
"schema": {
"type": "object",
"properties": {
"order_id": {
"description": "Order number.",
"type": "string"
},
"damaged_boxes": {
"description": "How many boxes arrived damaged.",
"type": "integer"
},
"request": {
"description": "What the customer asks for first.",
"type": "string",
"enum": [
"replacement",
"refund"
]
},
"fallback": {
"description": "What the customer accepts if the request is not possible.",
"type": "string",
"enum": [
"replacement",
"refund",
"none"
]
},
"deadline": {
"description": "When the customer needs it by, or null.",
"type": [
"string",
"null"
]
}
},
"required": [
"order_id",
"damaged_boxes",
"request",
"fallback",
"deadline"
],
"additionalProperties": false
}
}
}
}Response
The answer, read as JSON
damaged_boxes2deadline"Friday"fallback"refund"order_id"8812"request"replacement"
With strict set to true, the answer follows the schema of the request: every field, with its type, and no others.
The response as JSON, recorded on 14 November 2026, without its id and timestamps
{
"object": "chat.completion",
"model": "orion-plus",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "{\n \"damaged_boxes\": 2,\n \"deadline\": \"Friday\",\n \"fallback\": \"refund\",\n \"order_id\": \"8812\",\n \"request\": \"replacement\"\n}"
},
"finish_reason": "stop"
}
],
"usage": {
"completion_tokens": 54,
"prompt_tokens": 128,
"total_tokens": 182,
"completion_tokens_details": {
"reasoning_tokens": 0
},
"prompt_tokens_details": {
"cached_tokens": 0
}
}
}Responses API: drafting a reply
Orion Plus through OpenAI’s Responses API, the interface of client.responses.create and of Codex: instructions and input in, output items back. Stateless: nothing is stored.
- Route
POST /v1/responses- Model
orion-plus- Tokens
- 81 input and 54 output
Show the cURL command
Put your key in the SERENITY_EDGE_API_KEY environment variable first.
curl https://api.serenityedge.ai/v1/responses \
-H "Authorization: Bearer $SERENITY_EDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "orion-plus",
"instructions": "Draft a polite two-sentence reply to the customer, in English, for a support agent to review.",
"input": "Order 8812 arrived with two damaged boxes. I need replacements before Friday because we have a trade fair on Saturday. If that is not possible, I would rather have a refund for those two boxes.",
"max_output_tokens": 200
}'Request
{
"model": "orion-plus",
"instructions": "Draft a polite two-sentence reply to the customer, in English, for a support agent to review.",
"input": "Order 8812 arrived with two damaged boxes. I need replacements before Friday because we have a trade fair on Saturday. If that is not possible, I would rather have a refund for those two boxes.",
"max_output_tokens": 200
}Response
The text of the message item
Thank you for bringing this to our attention, and I sincerely apologize for the inconvenience caused by the damaged boxes. We will immediately look into sending replacements to ensure they arrive before your trade fair, or process a full refund for those items if that is your preferred solution.
The response says store: false. To continue the conversation, send the earlier turns in input.
The response as JSON, recorded on 14 November 2026, without its id and timestamps
{
"object": "response",
"status": "completed",
"model": "orion-plus",
"output": [
{
"id": "msg_7b8a448a18ccc870ac9edd7cd731514f",
"type": "message",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Thank you for bringing this to our attention, and I sincerely apologize for the inconvenience caused by the damaged boxes. We will immediately look into sending replacements to ensure they arrive before your trade fair, or process a full refund for those items if that is your preferred solution.",
"annotations": [],
"logprobs": []
}
]
}
],
"store": false,
"usage": {
"input_tokens": 81,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 54,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 135
}
}Decisions: triaging a ticket
PreviewOrion Compass answers three questions about a support ticket in a single call: whether it asks for a refund, which team should handle it and how urgent it is. Every answer comes with its probability.
- Route
POST /v1/decisions- Model
orion-compass- Tokens
- 348 input
Show the cURL command
Put your key in the SERENITY_EDGE_API_KEY environment variable first.
curl https://api.serenityedge.ai/v1/decisions \
-H "Authorization: Bearer $SERENITY_EDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "orion-compass",
"input": "Ticket 4821. Customer: You charged me twice for the same order last week. Refund the duplicate charge today or I will dispute it with my bank.",
"questions": [
{
"type": "predicate",
"name": "refund",
"instructions": "Is the customer asking for a refund?"
},
{
"type": "choice",
"name": "team",
"instructions": "Which team should handle the ticket?",
"choices": [
{
"value": "billing",
"description": "Payments, charges and refunds"
},
{
"value": "logistics",
"description": "Shipping and deliveries"
},
{
"value": "technical",
"description": "Problems with the app"
}
]
},
{
"type": "score",
"name": "urgency",
"instructions": "How urgent is the ticket?",
"levels": [
{
"value": 1,
"label": "low"
},
{
"value": 2,
"label": "normal"
},
{
"value": 3,
"label": "high"
},
{
"value": 4,
"label": "critical"
}
]
}
]
}'Request
{
"model": "orion-compass",
"input": "Ticket 4821. Customer: You charged me twice for the same order last week. Refund the duplicate charge today or I will dispute it with my bank.",
"questions": [
{
"type": "predicate",
"name": "refund",
"instructions": "Is the customer asking for a refund?"
},
{
"type": "choice",
"name": "team",
"instructions": "Which team should handle the ticket?",
"choices": [
{
"value": "billing",
"description": "Payments, charges and refunds"
},
{
"value": "logistics",
"description": "Shipping and deliveries"
},
{
"value": "technical",
"description": "Problems with the app"
}
]
},
{
"type": "score",
"name": "urgency",
"instructions": "How urgent is the ticket?",
"levels": [
{
"value": 1,
"label": "low"
},
{
"value": 2,
"label": "normal"
},
{
"value": 3,
"label": "high"
},
{
"value": 4,
"label": "critical"
}
]
}
]
}Response
Ticket 4821. Customer: You charged me twice for the same order last week. Refund the duplicate charge today or I will dispute it with my bank.
refundYes or no
Is the customer asking for a refund?
- Yes (most likely)99.9%
- No0.1%
teamOne choice
Which team should handle the ticket?
- billing (most likely)99.9%
- logistics< 0.1%
- technical< 0.1%
urgencyScale
How urgent is the ticket?
- low0.6%
- normal9.9%
- high (most likely)61.8%
- critical27.8%
Embeddings: sentence similarity
Qwen3 Embedding 0.6B turns three customer questions into vectors. The first two ask the same thing in different words and sit much closer to each other than to the third.
- Route
POST /v1/embeddings- Model
qwen3-embedding-0.6b- Tokens
- 33 input
Show the cURL command
Put your key in the SERENITY_EDGE_API_KEY environment variable first.
curl https://api.serenityedge.ai/v1/embeddings \
-H "Authorization: Bearer $SERENITY_EDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-embedding-0.6b",
"input": [
"How do I change the delivery address?",
"I want to change where my order is delivered.",
"What are your customer service hours?"
]
}'Request
{
"model": "qwen3-embedding-0.6b",
"input": [
"How do I change the delivery address?",
"I want to change where my order is delivered.",
"What are your customer service hours?"
]
}Response
Texts
- 1How do I change the delivery address?
- 2I want to change where my order is delivered.
- 3What are your customer service hours?
1,024 dimensions per vector
Cosine similarity, computed from the returned vectors
- Texts 1 and 20.846
- Texts 1 and 30.388
Rerank: the best answer to a question
Qwen3 Reranker 0.6B orders four help texts by their relevance to a customer question and returns the best three.
- Route
POST /v1/rerank- Model
qwen3-reranker-0.6b- Tokens
- 89 input, estimated from characters
Show the cURL command
Put your key in the SERENITY_EDGE_API_KEY environment variable first.
curl https://api.serenityedge.ai/v1/rerank \
-H "Authorization: Bearer $SERENITY_EDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-reranker-0.6b",
"query": "How do I return an order?",
"documents": [
"The return period is 30 days from delivery.",
"Our customer service hours are 9:00 to 18:00.",
"To return an order, request the label from your account and drop the parcel off at any collection point.",
"Deliveries to the Canary Islands take 3 to 5 working days."
],
"top_n": 3
}'Request
{
"model": "qwen3-reranker-0.6b",
"query": "How do I return an order?",
"documents": [
"The return period is 30 days from delivery.",
"Our customer service hours are 9:00 to 18:00.",
"To return an order, request the label from your account and drop the parcel off at any collection point.",
"Deliveries to the Canary Islands take 3 to 5 working days."
],
"top_n": 3
}Response
Query: How do I return an order?
The most relevant, in order
- 1
To return an order, request the label from your account and drop the parcel off at any collection point.
relevance 0.9995 - 2
The return period is 30 days from delivery.
relevance 0.0102 - 3
Our customer service hours are 9:00 to 18:00.
relevance 0.0031
Left out of the results
- Deliveries to the Canary Islands take 3 to 5 working days.
Redaction: personal data masked
Privacy Filter finds the name, email address, phone number and IBAN in a message and replaces them with labels, so the text can be processed without that data.
- Route
POST /v1/redact- Model
privacy-filter(default)- Tokens
- 34 input, estimated from characters
Show the cURL command
Put your key in the SERENITY_EDGE_API_KEY environment variable first.
curl https://api.serenityedge.ai/v1/redact \
-H "Authorization: Bearer $SERENITY_EDGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"inputs": "Hi, I'\''m Emma Clarke. You can email me at emma.clarke@example.com or call me on +44 7700 900123. My IBAN is GB29 NWBK 6016 1331 9268 19."
}'Request
{
"inputs": "Hi, I'm Emma Clarke. You can email me at emma.clarke@example.com or call me on +44 7700 900123. My IBAN is GB29 NWBK 6016 1331 9268 19."
}Response
Text sent, with the data found
Hi, I'm Emma ClarkePerson. You can email me at emma.clarke@example.comEmail or call me on +44 7700 900123Phone. My IBAN is GB29 NWBK 6016 1331 9268 19Account number.
Text returned
Hi, I'm [PERSON]. You can email me at [EMAIL] or call me on [PHONE]. My IBAN is [ACCOUNT_NUMBER].
Try it with your own code
Change the base URL and send these same requests from your application.
