Responses
Endpoint
POST https://llm.siraya.pro/v1/responses
Basic message
Use the OpenResponses API to generate text responses from AI models. The input array contains message objects with a role (user or assistant) and content field. The model processes the input and returns a response with the generated text.
Example request
import os
import requests
import json
url = "https://llm.siraya.pro/v1/responses"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <API_KEY>",
}
data = {
"model": "o4-mini",
"input": [
{
"type": "message",
"role": "user",
"content": "Why do developers prefer dark mode?",
}
],
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
const response = await fetch('https://llm.siraya.pro/v1/responses', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <API_KEY>`,
},
body: JSON.stringify({
model: 'o4-mini',
input: [
{
type: 'message',
role: 'user',
content: 'Why do developers prefer dark mode?',
},
],
}),
});
const result = await response.json();
Response format
The response includes the generated text in the output array, along with token usage information.
{
'background': False,
'completed_at': 1771665090,
'created_at': 1771665084,
'error': None,
'frequency_penalty': 0,
'id': 'resp_07223b6d861d05ef00699976bc037481948075cde62d82e221',
'incomplete_details': None,
'instructions': None,
'max_output_tokens': None,
'max_tool_calls': None,
'metadata': {},
'model': 'o4-mini',
'object': 'response',
'output': [{
'id': 'rs_07223b6d861d05ef00699976bccb48819487f777752fc4925f',
'summary': [],
'type': 'reasoning'
}, {
'content': [{
'annotations': [],
'logprobs': [],
'text': 'Developers’ fondness for dark mode comes down to a mix of physiological, practical and even psychological factors. Some of the most commonly cited reasons:\n\n1. Reduced eye strain in low-light environments \n – A bright white screen in a dark room can feel harsh and cause glare. Dark backgrounds with lighter text are often perceived as gentler on the eyes when ambient light is low. \n – Less overall luminance can help prevent headaches and eye fatigue over long coding sessions.\n\n2. Better contrast for syntax highlighting \n – Modern code editors use multiple colors to distinguish keywords, strings, comments, etc. On a dark background, those hues often “pop” more distinctly, making it easier to scan and parse code structures quickly.\n\n3. Reduced blue-light exposure \n – Dark mode typically emits less overall blue light, which can interfere with circadian rhythms and keep you awake if you’re coding late at night.\n\n4. Battery savings on OLED/AMOLED screens \n – On these displays, black or very dark pixels are essentially “off” pixels, drawing less power. If you’re coding on a laptop or tablet running on battery, dark mode can eke out a bit more runtime.\n\n5. Minimized screen flicker and pulse perception \n – Some users who are sensitive to rapid backlight flicker find dark mode more comfortable, as it reduces the perceived pulse of a bright LCD backlight.\n\n6. Aesthetics and focus \n – Many developers simply “like the look” of dark themes—it feels more modern, sleek or immersive. That sense of immersion can help with focus and flow when you’re debugging or deep-diving into logic.\n\n7. Community and tooling momentum \n – Once a few popular editors (VS Code, JetBrains IDEs, etc.) introduced polished dark themes, the rest of the ecosystem followed. Code samples and screenshots on blogs and Stack Overflow often assume a dark theme, which reinforces its popularity.\n\n8. Personal preference and habit \n – At the end of the day, it often boils down to individual comfort. If you started out working in a dark-mode editor and find it soothing, you’ll set your other tools to match.\n\nCaveat: In very bright environments (e.g. outdoors or under strong overhead office lighting), a dark UI can become harder to read. Some developers switch dynamically—dark mode at night, light mode during the day. Ultimately, it’s less about objective “rightness” and more about finding what keeps you comfortable, focused and productive over long coding sessions.',
'type': 'output_text'
}],
'id': 'msg_07223b6d861d05ef00699976be60988194aa6ebc90f21a1c18',
'role': 'assistant',
'status': 'completed',
'type': 'message'
}],
'parallel_tool_calls': True,
'presence_penalty': 0,
'previous_response_id': None,
'prompt_cache_key': None,
'prompt_cache_retention': None,
'reasoning': {
'effort': 'medium',
'summary': None
},
'safety_identifier': None,
'service_tier': 'default',
'status': 'completed',
'store': True,
'temperature': 1,
'text': {
'format': {
'type': 'text'
},
'verbosity': 'medium'
},
'tool_choice': 'auto',
'tools': [],
'top_logprobs': 0,
'top_p': 1,
'truncation': 'disabled',
'usage': {
'input_tokens': 13,
'input_tokens_details': {
'cached_tokens': 0
},
'output_tokens': 720,
'output_tokens_details': {
'reasoning_tokens': 192
},
'total_tokens': 733
},
'user': None
}
Image Input
The OpenResponses API supports sending images alongside text for vision-capable models to analyze. Include an image_url object in your message content array with either a public URL or a base64-encoded data URI. The detail parameter controls the resolution used for analysis.
import os
import requests
import json
url = "https://llm.siraya.pro/v1/responses"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <API_KEY>",
}
data = {
"model": "z-ai/glm-4.7",
"input": [
{
"type": "message",
"role": "user",
"content": [
{"type": "text", "text": "Describe this image in detail."},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/image.jpg",
"detail": "auto"
},
},
],
},
],
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
const response = await fetch('https://llm.siraya.pro/v1/responses', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <API_KEY>`,
},
body: JSON.stringify({
model: 'z-ai/glm-4.7',
input: [
{
type: 'message',
role: 'user',
content: [
{ type: 'text', text: 'Describe this image in detail.' },
{
type: 'image_url',
image_url: { url: 'https://example.com/image.jpg', detail: 'auto' },
},
],
},
],
}),
});
Base64-encoded images
You can also use base64-encoded images:
Detail parameter
The detail parameter controls image resolution:
auto- Let the model decide the appropriate resolutionlow- Use lower resolution for faster processinghigh- Use higher resolution for more detailed analysis
Compatible with Gemini series models [Beta]
Info
The compatible interface is currently in beta and may have some stability and compatibility issues. Please use it with caution.
Example request
import os
import requests
import json
url = "https://llm.siraya.pro/v1/responses"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <API_KEY>",
}
data = {
"model": "gemini-3-flash-preview",
"input": [
{
"type": "message",
"role": "user",
"content": "Why do developers prefer dark mode?",
}
],
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
Response format
{
'id': 'resp_2af861af766e4a23b83d92dfb19ffb9c',
'object': 'realtime.response',
'created_at': 1771815795,
'status': 'completed',
'error': None,
'output_text': '',
'output': [{
'type': 'message',
'id': 'item_654c273a702d4870bc6144bb757d1894',
'status': 'completed',
'role': 'assistant',
'content': [{
'type': 'text',
'text': 'The preference for dark mode among developers is so prevalent that it has become a staple of "coder culture." While some of it is down to aesthetics, there are several functional, physiological, and psychological reasons behind the choice.\n\nHere is a breakdown of why developers prefer dark mode:\n\n### 1. Reduced Eye Strain (Digital Eye Strain)\nDevelopers spend 8 to 12 hours a day staring at screens. A bright white background emits a significant amount of light, which can lead to "monitor glow" and physical fatigue. \n* **Reduced Glare:** Dark mode reduces the overall brightness of the screen, making it more comfortable to look at for extended periods.\n* **Less "Flicker":** While modern monitors don\'t flicker like old CRTs, the intensity of a white screen can feel "harsh" on the eyes, leading to headaches or blurred vision.\n\n### 2. Enhanced Syntax Highlighting\nCoding is not just reading; it’s scanning. Code editors use **syntax highlighting** (coloring different parts of the code like variables, functions, and strings) to help developers understand logic at a glance.\n* **High Contrast:** Vibrant colors (like neon pink, cyan, and lime green) "pop" much more effectively against a dark grey or black background than they do on white. \n* **Readability:** This increased contrast makes it easier to spot typos or logic errors quickly.\n\n### 3. Focus and "The Flow"\nDeveloping software requires deep concentration, often referred to as "The Flow." \n* **Receding UI:** In dark mode, the peripheral elements of the software (toolbars, menus, and sidebars) tend to recede into the background, while the colorful code stays in the foreground. \n* **Less Distraction:** A bright white screen can be visually "loud." Dark mode creates a "tunnel vision" effect that helps developers stay focused on the specific lines of code they are writing.\n\n### 4. Working in Low-Light Environments\nMany developers prefer working in dimly lit rooms or late at night. \n* **Contrast with Environment:** If the room is dark and the screen is bright white, the contrast is extremely high, which is painful for the eyes (similar to looking at a flashlight in a dark room). \n* **Melatonin and Sleep:** Dark mode reduces exposure to blue light. Since many developers work late, reducing blue light helps prevent the suppression of melatonin, making it easier to fall asleep after a long coding session.\n\n### 5. Energy Efficiency (OLED Screens)\nOn modern OLED and AMOLED screens (found in many high-end laptops and monitors), dark mode actually saves power. \n* **Pixel Power:** In an OLED screen, black pixels are essentially "off" and consume no power. For developers working on battery power, this can lead to noticeably longer battery life.\n\n### 6. Aesthetics and "The Hacker" Identity\nThere is a psychological and cultural element to the choice as well. \n* **Legacy:** Early computers (like the original terminals) had black screens with green or white text due to the limitations of cathode-ray tubes. For many, dark mode feels like a return to the "authentic" roots of computing.\n* **Professionalism:** Dark mode is often perceived as looking more "pro," sleek, and modern compared to the "office paper" look of light mode.\n\n---\n\n### The "But" (Astigmatism and Light Mode)\nInterestingly, dark mode isn\'t objectively "better" for everyone. \n* **Halation Effect:** People with **astigmatism** (which affects a large percentage of the population) often find dark mode harder to read. This is because, in dark mode, the iris opens wider to let in more light, which can cause the white text to "bleed" or blur into the black background. \n* **Reading Speed:** Some studies suggest that humans are faster at reading long-form prose (like an article) in light mode, as we have been trained for centuries to read black ink on white paper.\n\n### Summary\nFor most developers, the choice is about **stamina.** Dark mode allows them to stay in front of a screen for 10 hours with less physical discomfort than a bright white interface would allow.',
'annotations': None
}]
}],
'model': 'gemini-3-flash-preview',
'incomplete_details': None,
'max_tool_calls': None,
'tools': None,
'tool_choice': None,
'parallel_tool_calls': False,
'max_output_tokens': None,
'temperature': None,
'top_p': None,
'metadata': None,
'background': False,
'previous_response_id': None,
'service_tier': '',
'truncation': None,
'store': False,
'instructions': None,
'reasoning': None,
'safety_identifier': None,
'prompt_cache_key': None,
'user': None,
'usage': {
'prompt_tokens': 7,
'completion_tokens': 905,
'total_tokens': 1544,
'completion_tokens_details': {
'reasoning_tokens': 632
},
'input_tokens': 0,
'output_tokens': 0,
'ttft': 0,
'server_tool_use': {
'web_search_requests': ''
}
}
}
Compatible with Claude series models [Beta]
Info
The compatible interface is currently in beta and may have some stability and compatibility issues. Please use it with caution.
Example request
import os
import requests
import json
url = "https://llm.siraya.pro/v1/responses"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <API_KEY>",
}
data = {
"model": "claude-sonnet-4.6",
"input": [
{
"type": "message",
"role": "user",
"content": "Why do developers prefer dark mode?",
}
],
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
Response format
{
'background': False,
'created_at': 1771815911,
'error': None,
'id': 'msg_bdrk_01XZhcCRbteLQRPSTAtDAE5G',
'incomplete_details': None,
'instructions': None,
'max_output_tokens': None,
'max_tool_calls': None,
'metadata': None,
'model': 'claude-sonnet-4-6',
'object': 'responses.output',
'output': [{
'content': [{
'annotations': None,
'text': '# Why Developers Prefer Dark Mode\n\nHere are the main reasons, ranging from practical to somewhat humorous:\n\n## Practical Reasons\n- **Eye strain reduction** during long coding sessions, especially in low-light environments\n- **Better contrast** for reading text and syntax highlighting\n- **Reduced blue light** emission, potentially improving sleep if working late\n- **Battery savings** on OLED/AMOLED screens\n\n## Workflow Reasons\n- **Syntax highlighting pops more** visually against dark backgrounds\n- **Multiple screens** are easier to manage without harsh brightness differences\n- **Terminal/console familiarity** - command lines have historically been dark\n\n## Honest Considerations\n- Research on whether dark mode actually reduces eye strain is **mixed**\n- Some studies suggest **light mode aids reading comprehension**\n- It may partly be **habit and culture** within developer communities\n- **Individual preference** varies significantly\n\n## The Cultural Element\n- It has become something of a **developer identity marker**\n- Associated with a "serious programmer" aesthetic\n- Many developers simply **grew up with dark terminals**\n\n## Bottom Line\nThe preference is a combination of **genuine ergonomic benefits** for specific conditions, **workflow habits**, and honestly some **professional culture/tradition**.\n\nDo you prefer dark or light mode yourself?',
'type': 'output_text'
}],
'id': 'output_502d86fbc899412cbdde9bf488ad4345',
'role': 'assistant',
'status': 'completed',
'type': 'output_text'
}],
'output_text': '',
'parallel_tool_calls': False,
'previous_response_id': None,
'prompt_cache_key': None,
'reasoning': None,
'safety_identifier': None,
'service_tier': '',
'status': 'completed',
'store': False,
'temperature': None,
'tool_choice': None,
'tools': None,
'top_p': None,
'truncation': None,
'usage': {
'completion_tokens': 287,
'input_tokens': 0,
'output_tokens': 0,
'prompt_tokens': 14,
'prompt_tokens_details': {},
'server_tool_use': {
'web_search_requests': ''
},
'total_tokens': 301,
'ttft': 0
},
'user': None
}