ShareAI Platform Docs

Create a chat completion

Send a ShareAI chat-completions request with a Bearer API key and understand the supported model, messages and stream fields.

View as Markdown
On this page
POST https://api.shareai.now/api/v1/chat/completions

Run a chat request using the selected model.

Base URL
https://api.shareai.now
Authentication
Bearer API key

This is the default integration path for requests paid and authorized by your API-key workspace. The key’s model and provider restrictions apply to allocation, including permitted fallback paths.

Request body#

FieldTypeMeaning
modelstring, requiredExact available model identifier. Copy it from Models.
messagesarrayConversation messages containing role and content.
streambooleanfalse returns one JSON result; true requests server-sent events.

Use text message content. Send roles such as system, user and assistant as appropriate to the conversation. Include the conversation history you want the model to use; do not assume requests share a stored conversation.

cURL

curl --fail-with-body --request POST \
  "https://api.shareai.now/api/v1/chat/completions" \
  -H "Authorization: Bearer $SHAREAI_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "MODEL_IDENTIFIER",
  "messages": [
    {
      "role": "system",
      "content": "Be concise and helpful."
    },
    {
      "role": "user",
      "content": "Give me three ideas for a local community event."
    }
  ],
  "stream": false
}'

Response#

A completed non-streaming result sets done to true and returns the generated text at message.content. The top level also carries done_reason and consumption_type. Streaming uses a different, chat-completion-chunk format. Do not assume the non-streaming result has an OpenAI-style choices array.

JSON

{
  "done": true,
  "done_reason": "stop",
  "consumption_type": "credits",
  "message": {
    "role": "assistant",
    "content": "Here are three ideas for your community event.",
    "done": true,
    "done_reason": "stop"
  }
}

This is an illustrative completed result; consumption_type describes the actual allocation mode. Check for a top-level error even when HTTP status is 200. A no-device result currently uses error.code = no_device with HTTP 200.

Model and provider restrictions#

A key may be limited to specific models and execution providers. If access is denied, inspect key information and update the key in Console only if the owning workspace intends to grant that access.

Streaming or customer authorization#

Stream a response · Use an OAuth access token

Last updated September 15, 2026

ShareAI Platform Docs
All documentation

Search by title or content.

Ask about this page

Choose an assistant to explore this page. You can also copy the page and paste it into your conversation.

Ask ChatGPTAsk ClaudeAsk GrokAsk ShareAI