curl --request POST \
--url https://api.sunbird.ai/tasks/sunflower_inference \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"model_type": "qwen",
"temperature": 0.3,
"stream": false,
"system_message": "<string>"
}
'import requests
url = "https://api.sunbird.ai/tasks/sunflower_inference"
payload = {
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"model_type": "qwen",
"temperature": 0.3,
"stream": False,
"system_message": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [{role: '<string>', content: '<string>'}],
model_type: 'qwen',
temperature: 0.3,
stream: false,
system_message: '<string>'
})
};
fetch('https://api.sunbird.ai/tasks/sunflower_inference', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sunbird.ai/tasks/sunflower_inference",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'messages' => [
[
'role' => '<string>',
'content' => '<string>'
]
],
'model_type' => 'qwen',
'temperature' => 0.3,
'stream' => false,
'system_message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sunbird.ai/tasks/sunflower_inference"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"model_type\": \"qwen\",\n \"temperature\": 0.3,\n \"stream\": false,\n \"system_message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sunbird.ai/tasks/sunflower_inference")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"model_type\": \"qwen\",\n \"temperature\": 0.3,\n \"stream\": false,\n \"system_message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sunbird.ai/tasks/sunflower_inference")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"model_type\": \"qwen\",\n \"temperature\": 0.3,\n \"stream\": false,\n \"system_message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"content": "<string>",
"model_type": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123
},
"processing_time": 123,
"inference_time": 0,
"message_count": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Sunflower Inference
curl --request POST \
--url https://api.sunbird.ai/tasks/sunflower_inference \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"model_type": "qwen",
"temperature": 0.3,
"stream": false,
"system_message": "<string>"
}
'import requests
url = "https://api.sunbird.ai/tasks/sunflower_inference"
payload = {
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"model_type": "qwen",
"temperature": 0.3,
"stream": False,
"system_message": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
messages: [{role: '<string>', content: '<string>'}],
model_type: 'qwen',
temperature: 0.3,
stream: false,
system_message: '<string>'
})
};
fetch('https://api.sunbird.ai/tasks/sunflower_inference', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sunbird.ai/tasks/sunflower_inference",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'messages' => [
[
'role' => '<string>',
'content' => '<string>'
]
],
'model_type' => 'qwen',
'temperature' => 0.3,
'stream' => false,
'system_message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sunbird.ai/tasks/sunflower_inference"
payload := strings.NewReader("{\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"model_type\": \"qwen\",\n \"temperature\": 0.3,\n \"stream\": false,\n \"system_message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sunbird.ai/tasks/sunflower_inference")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"model_type\": \"qwen\",\n \"temperature\": 0.3,\n \"stream\": false,\n \"system_message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sunbird.ai/tasks/sunflower_inference")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"model_type\": \"qwen\",\n \"temperature\": 0.3,\n \"stream\": false,\n \"system_message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"content": "<string>",
"model_type": "<string>",
"usage": {
"completion_tokens": 123,
"prompt_tokens": 123,
"total_tokens": 123
},
"processing_time": 123,
"inference_time": 0,
"message_count": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
Request model for Sunflower chat inference.
Attributes: messages: List of conversation messages. model_type: The model to use ('qwen'). temperature: Sampling temperature (0.0 to 2.0). stream: Whether to stream the response. system_message: Optional custom system message.
List of conversation messages
Show child attributes
Show child attributes
Model type: 'qwen'
Sampling temperature
0 <= x <= 2Whether to stream the response
Custom system message
Response
Successful Response
Response model from Sunflower chat inference.
Attributes: content: The AI's response text. model_type: The model used for inference. usage: Token usage statistics. processing_time: Total processing time in seconds. inference_time: Model inference time in seconds. message_count: Number of messages processed.
The AI's response
Model used for inference
Token usage statistics
Show child attributes
Show child attributes
Total processing time in seconds
Model inference time in seconds
Number of messages processed

