Skip to main content
Sunflower is Sunbird AI’s large language model, fine-tuned for 20+ Ugandan languages and cultural context. It provides conversational AI through an OpenAI-compatible endpoint: POST /tasks/chat/completions. Because the request and response formats mirror the OpenAI Chat Completions API, you can move between the OpenAI API and the Sunbird API by changing only the base URL and API key.
Deprecated: POST /tasks/sunflower_inference and POST /tasks/sunflower_simple are deprecated and will be removed in a future release. Use POST /tasks/chat/completions instead — a single instruction is just a request with one user message.

Chat Completion

Example Request

Response

Using the OpenAI SDK

Because the endpoint is OpenAI-compatible, the official OpenAI Python SDK works out of the box — just point base_url at https://api.sunbird.ai/tasks:

Multi-turn Conversations

Maintain context by sending the running message history. Each message has a role and content:
  • system: Sets the behavior and persona of the AI. When omitted, a default Sunflower system message is applied.
  • user: The input from the human user.
  • assistant: A previous response from the AI (used for history).

Streaming

Set "stream": true to receive Server-Sent Events in OpenAI chat.completion.chunk format, terminated by data: [DONE]. With the OpenAI SDK:

Supported Parameters