1. Chat
Storm OpenAPI(en)
  • Welcome to STORM
    • Introduction
  • Quickstart
    • Getting Started
      • Account Creation
      • Creating an Agent
    • Core Scenario
      • Document Upload
      • Workflow Design
      • Test
      • Deployment
      • Channel Integration
  • Feature Guide
    • Console
      • Agent Management
      • Dashboard
      • Permission Management
    • Agent Template
      • Deep Knowledge Exploration
      • Explore knowledge
      • Free Chat
      • Create reports
      • FAQ Chatbot
      • Resume Screening
      • Character Conversation
      • Analyze chat history
      • Write articles
      • Write SQL queries
    • Agent Builder
      • Knowledge
        • Documents
        • Folders
        • Feedback
      • Workflow
        • Node Description
          • LLM
          • Search(RAG)
          • Agentic RAG
          • API
          • IF ELSE
          • Variable Declaration and Assignment
          • Postprocessing
          • Response
          • Loop
          • Document Generation
      • Test
      • Log
      • Dashboard
    • Admin Tools
      • Deployment Management
      • Channel Integration
      • Model Fine-Tuning
      • Training Data Quality Management
      • Other Settings
      • Teams Channel Integration
  • Apis
    • Agent
      • Deploy Agent
      • View Agent Deployment History
      • View Agent
    • Bucket
      • Create Bucket
      • View Bucket
    • Document
      • Document Training Request by file
      • Document Training Request by URL
      • View Documents
      • Delete Document
    • Chat
      • File upload during chat
        • File creation and presigned URL issuance
        • File upload completion handling
        • File status lookup
      • Chat Sending (OpenAI Compatible)
        POST
      • Send Chat (non-stream)
        POST
      • Send Chat (stream)
        POST
      • Search Context
        POST
    • STORM Parse
      • /convert/md
    • Instance Agent
      • Add Instance Session
      • Upload Instance Document
      • Request RAG Source For Query
      • Delete Instance Session
  • Learn More
    • FAQ
    • Pricing
    • Error Code Guide
      • AgentRag
      • ApiCall
      • DocGen
      • Function
      • IfElse
      • Loop
      • OpenLLM
      • Post
      • Rag
      • Response
      • Variable
  1. Chat

Chat Sending (OpenAI Compatible)

Developing
POST
/api/openai/v1/chat/completions
The OpenAI Compatible Chat Completions API provides an interface that is compatible with OpenAIโ€™s Chat Completions API.
You can use existing OpenAI SDKs or libraries with little to no modification, while also accessing Sionic AIโ€“specific features (such as RAG context, custom variables, and node execution tracing) through the x_sionic extension field.

Request

Authorization
Add parameter in header
storm-api-key
Example:
storm-api-key: ********************
Query Params

Header Params

Body Params application/jsonRequired

Examples

Responses

๐ŸŸข200Success
application/json
Bodyapplication/json

๐ŸŸข200Success (Stream)
๐ŸŸ 400Request Validation Error
๐ŸŸ 401Unauthorized
๐ŸŸ 403Forbidden
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location '/api/openai/v1/chat/completions' \
--header 'storm-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
    "messages": [
        {
            "role": "system",
            "content": "You are a helpful assistant."
        },
        {
            "role": "user",
            "content": "Please tell me about the company'\''s vacation policy."
        }
    ],
    "stream": true
}'
Response Response Example
200 - Non-streaming response
{
    "id": "chat_xyz123abc456",
    "object": "chat.completion",
    "created": 1705312800,
    "model": "gpt-4",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "The company's vacation policy is as follows:\n\n1. Annual leave: 15 days are granted in the first year of employment, and 1 additional day is added each year.\n2. Sick leave: Up to 30 days per year can be used.\n3. Special occasion leave: 5 days for your own marriage, 1 day for a child's marriage, etc."
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 50,
        "completion_tokens": 150,
        "total_tokens": 200
    },
    "x_sionic": {
        "thread_id": "thread_abc123def456",
        "agent_id": "agent_xyz789ghi012",
        "order_sheet_revision": 3,
        "contexts": [
            {
                "type": "document",
                "source_identifier": "dhash_abc123",
                "context": "Annual leave: 15 days are granted in the first year of employment...",
                "page_name": "Page 5",
                "file_name": "vacation policy.pdf",
                "bucket_name": "HR document",
                "reference_idx": 1,
                "is_golden_chunk": true,
                "golden_chunk_rank": 1,
                "download_urls": {
                    "original": "https://s3.amazonaws.com/...",
                    "converted": "https://s3.amazonaws.com/..."
                }
            }
        ],
        "custom_variables": {
            "employee_name": "Hong Gil-dong",
            "department": "Development Team"
        },
        "node_executions": [
            {
                "node_id": 1,
                "node_type": "request",
                "started_at": "2024-01-15T10:00:00.000Z",
                "ended_at": "2024-01-15T10:00:00.050Z",
                "status": "success",
                "duration_ms": 50
            },
            {
                "node_id": 2,
                "node_type": "rag",
                "started_at": "2024-01-15T10:00:00.050Z",
                "ended_at": "2024-01-15T10:00:01.200Z",
                "status": "success",
                "duration_ms": 1150
            },
            {
                "node_id": 3,
                "node_type": "llm",
                "started_at": "2024-01-15T10:00:01.200Z",
                "ended_at": "2024-01-15T10:00:05.800Z",
                "status": "success",
                "duration_ms": 4600
            }
        ]
    }
}
Modified atย 2026-08-03 03:19:28
Previous
File status lookup
Next
Send Chat (non-stream)
Built with