Skip to main content
POST
/
tasks
/
sunflower_inference
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>"
}
'
{
  "content": "<string>",
  "model_type": "<string>",
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123
  },
  "processing_time": 123,
  "inference_time": 0,
  "message_count": 0
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

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.

messages
SunflowerChatMessage · object[]
required

List of conversation messages

model_type
string
default:qwen

Model type: 'qwen'

temperature
number
default:0.3

Sampling temperature

Required range: 0 <= x <= 2
stream
boolean
default:false

Whether to stream the response

system_message
string | null

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.

content
string
required

The AI's response

model_type
string
required

Model used for inference

usage
SunflowerUsageStats · object
required

Token usage statistics

processing_time
number
required

Total processing time in seconds

inference_time
number
default:0

Model inference time in seconds

message_count
integer
default:0

Number of messages processed