ShareAI Platform Docs

Make your first API request

Create a ShareAI API key, choose an available model and send a chat request from your server with Bearer authentication.

View as Markdown
On this page

Start here when your application will make requests using an API key from your own ShareAI workspace. You need a ShareAI account, an active key and access to the model you want to run.

1. Create an API key#

Open ShareAI Console and select the workspace that will own the key and usage. Open API Keys, choose Create API key, give the key a recognizable name and save the secret in your server environment.

Create and manage inference credentials from API Keys.Create and manage inference credentials from API Keys.
Create and manage inference credentials from API Keys.

2. Choose a model#

Open Models and copy the exact model identifier shown there. Check current availability and the model/provider restrictions on your key. An identifier in an old tutorial does not guarantee that capacity is available today.

3. Send the request#

POST https://api.shareai.now/api/v1/chat/completions

Generate a response using an available model.

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

Replace MODEL_IDENTIFIER with your selected identifier. Set SHAREAI_API_KEY in your environment before running the example.

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": "user",
      "content": "Explain what ShareAI does in one sentence."
    }
  ],
  "stream": false
}'

4. Read the result#

For a successful non-streaming request, check that done is true and read the assistant message from message.content. Check both the HTTP status and any error object in the body before treating it as a successful completion. A no-device result can currently arrive as an error object with HTTP 200.

If the request fails#

StatusNext step
401Check the key, workspace and Authorization header.
402Check available credits or the applicable balance.
403Check allowed models and providers.
429Wait for Retry-After when present, then retry with a bounded delay.
503Check current capacity or service availability; keep a retry limit.

Next steps#

Chat request and response reference explains the supported body. If each customer should authorize their own account, follow application OAuth.

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