Assistiv Docs

Quick Start

Go from zero to your first AI inference call in 5 steps. This guide walks you through getting your credentials, configuring an LLM provider, creating an end user, and making a chat completion request.

1

Get Your Platform API Key

Assistiv provisions your platform and gives you two things you'll use in every API call: a platform API key and a platform ID.

Platform API Key

Goes in the Authorization header on every management request.

sk-plat_fc0aedc22d4d...

Platform ID

UUID that appears in every endpoint URL. Find it in your dashboard under Settings → Platform info.

f47ac10b-58cc-4372-...
bash
# Set these as environment variables:
ASSISTIV_PLATFORM_KEY=sk-plat_your_key_here
ASSISTIV_PLATFORM_ID=your-platform-uuid   # from dashboard Settings

# Every management endpoint uses both:
curl https://api.assistiv.ai/v1/platforms/$ASSISTIV_PLATFORM_ID/end-users \
  -H "Authorization: Bearer $ASSISTIV_PLATFORM_KEY"

Keep your platform key server-side

Never expose sk-plat_* in client-side code. It can manage all users and billing on your platform. End-user keys (sk-eu_*) are safe for client-side use.

2

Configure an LLM Provider

Add your provider API key (e.g. OpenAI) so the inference service can route requests. The key is encrypted with AES-256-GCM before storage.

bash
curl -X POST https://api.assistiv.ai/v1/platforms/{platformId}/llm-configs \
  -H "Authorization: Bearer sk-plat_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "provider_id": "provider-uuid-for-openai",
    "api_key": "sk-openai-your-key-here",
    "is_default": true
  }'

To find provider IDs, use the admin endpoint GET /v1/admin/providers or check the dashboard Providers page.

3

Create an End User

End users represent the people using your platform. Each gets their own API key and optional budget.

bash
curl -X POST https://api.assistiv.ai/v1/platforms/{platformId}/end-users \
  -H "Authorization: Bearer sk-plat_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "user-123",
    "display_name": "Jane Smith"
  }'

The response includes an auto-generated end-user API key:

json
{
  "data": {
    "id": "uuid-here",
    "external_id": "user-123",
    "display_name": "Jane Smith",
    "api_key": {
      "key_prefix": "sk-eu_10",
      "raw_key": "sk-eu_103c5bb1fd2bd35d..."}
  }
}
4

Top Up the Wallet

Before making inference calls, your platform wallet needs a balance. The wallet is debited after each successful LLM request.

bash
curl -X POST https://api.assistiv.ai/v1/platforms/{platformId}/wallet/topup \
  -H "Authorization: Bearer sk-plat_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50.00,
    "description": "Initial top-up"
  }'
5

Make a Chat Completion Request

Use the end-user API key to call the OpenAI-compatible chat completions endpoint on the inference service.

bash
curl -X POST https://api.assistiv.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-eu_end_user_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      { "role": "user", "content": "Hello, world!" }
    ]
  }'

The response follows the OpenAI chat completion format:

json
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "model": "gpt-4o",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"},
      "finish_reason": "stop"}
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 9,
    "total_tokens": 21
  }
}

OpenAI-compatible

The inference API is fully compatible with the OpenAI client libraries. Just point your OpenAI SDK to the inference URL and use an end-user API key.

What's Next?