ShareAI Platform Docs
KNOWLEDGE BASE

API Reference

Authenticate applications, generate text and images, create embeddings, and automate provider, device and creator workflows.

View as Markdown

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.

Choose the right API and credential

Find ShareAI API endpoints for application Auth, chat, Responses, embeddings, images, Providers, Devices and Creators, with the correct URL and credential.

Register your application

Create an application, choose its deployment model and enable only the ShareAI capabilities it needs.

Authorize an account with PKCE

Use authorization code plus S256 PKCE for confidential and public applications.

Choose Login, Pay and AI scopes

Login, product payments and inference surcharges require separate capabilities and customer authorization.

Refresh an access token

Rotate refresh tokens without expanding the customer’s authorized scopes.

Read identity and discover Auth endpoints

Use ShareAI Auth discovery, JWKS and UserInfo to validate application sign-in and read the identity permitted by an OAuth access token.

Revoke tokens and inspect server-side authorization

Revoke unused access and refresh tokens. Confidential integrations can also inspect token state.

Understand accepted billing agreements

Keep subscription price, interval and AI surcharge tied to the terms each customer accepted.

Create a chat completion

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

Send chat requests with OAuth

Use an approved ShareAI OAuth access token for customer-funded chat completions and handle token expiry, consent and account boundaries.

Stream a chat response

Read ShareAI chat-completions server-sent events, append content deltas once and handle completion, errors and interrupted streams.

Inspect key access and account identity

Read ShareAI API key information to check model and provider restrictions and the account identity associated with an inference credential.

Create a text response

Use the ShareAI Responses API for stateless text generation, explicit conversation history and Responses streaming events.

Create text embeddings

Generate text embeddings with ShareAI for semantic search, retrieval and similarity, with supported input formats and model requirements.

Generate an image

Create images with the ShareAI Images API using a supported model, a text prompt and validated image-generation options.

Authenticate the Provider API

Enable Provider Remote Access and use a provider UUID and scoped access token for catalog and pricing requests.

List provider and network models

Read the ShareAI Provider API network catalog, your provider catalog and exact model details using provider_models:read.

Update provider model pricing

Set ShareAI provider model input, output and cache pricing tiers using a scoped Provider API token and an exact model identifier.

Authenticate the Device API

Create a device-specific Remote Control token and understand the provider, device and enabled-state checks for ShareAI Device API requests.

Read device sessions and task history

List ShareAI device sessions and inspect a session’s task history using a device-specific Remote Control token.

Start and stop device sharing

Send ShareAI device sharing commands, distinguish accepted commands from observed state and verify the result in Console.

Authenticate the Creator API

Use creator-scoped Remote Access credentials and understand the collection, model and settings scopes available in the ShareAI Creator API.

Read and manage model collections

List, create and update ShareAI Creator model collections with the required scopes and clear ownership and review boundaries.

Create a model package

Create ShareAI Creator model metadata, a collection and model tags together, with explicit access policy and scoped API credentials.

Manage models within a collection

List, read, create and update ShareAI Creator model tags while preserving their collection ownership and effective serving policy.

Handle API errors and retries

Diagnose ShareAI authentication, scope, model-access and availability errors without duplicate writes or unsafe refresh retries.

Understand model creators, identifiers and tags

Choose an exact creator-based ShareAI model identifier, explore its family and compare the providers that can run it.

Choose execution providers for an API request

Use the ShareAI provider object to select execution providers independently from a model’s creator across all four inference endpoints.

Provider policy reference

Reference the ShareAI provider fields, defaults, limits and errors for choosing execution providers in inference requests.

Sort providers and control fallback

Understand ShareAI price, latency and throughput ranking, ordered providers, unavailable measurements and safe fallback boundaries.

Understand customer identities

Each OAuth client receives a different identifier for the same ShareAI customer.

Pay for products and subscriptions

Create a wallet checkout, let the customer confirm it in ShareAI, then verify the paid result before fulfillment.

Handle billing errors and customer spending limits

Distinguish insufficient credits from an application spending limit, present an actor-aware recovery link and handle streaming failures correctly.

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