> ## Documentation Index
> Fetch the complete documentation index at: https://docs.co-mind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

Get up and running with the co-mind.ai API. This guide walks you through authentication and your first API calls.

## Prerequisites

* API endpoint URL (provided by your administrator)
* User credentials (email and password)
* `curl` installed (or any HTTP client)

<Steps>
  <Step title="Health Check">
    Verify the API is reachable (no authentication required):

    ```bash theme={null}
    curl https://{BASE_URL}/health
    ```

    ```json theme={null}
    { "status": "ok" }
    ```
  </Step>

  <Step title="Authenticate">
    Login with your credentials to get an access token:

    ```bash theme={null}
    curl -X POST https://{BASE_URL}/v1/auth/login \
      -H "Content-Type: application/json" \
      -d '{
        "email": "user@example.com",
        "password": "your_password"
      }'
    ```

    ```json theme={null}
    {
      "access_token": "eyJhbGciOiJIUzI1NiIs...",
      "refresh_token": "eyJhbGciOiJIUzI1NiIs...",
      "token_type": "bearer",
      "expires_in": 3600
    }
    ```

    <Tip>
      For long-lived programmatic access, create a [Personal Access Token (PAT)](/guides/api-tokens) instead of using short-lived JWTs.
    </Tip>
  </Step>

  <Step title="List Available Models">
    Check which models are deployed on your instance:

    ```bash theme={null}
    curl https://{BASE_URL}/v1/models \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```

    ```json theme={null}
    {
      "object": "list",
      "data": [
        { "id": "Qwen/Qwen2.5-32B-Instruct", "object": "model", "owned_by": "vllm" },
        { "id": "llama3.2:3b", "object": "model", "owned_by": "ollama" }
      ]
    }
    ```
  </Step>

  <Step title="Send a Chat Completion">
    Make your first chat request using one of the available models:

    ```bash theme={null}
    curl -X POST https://{BASE_URL}/v1/chat/completions \
      -H "Authorization: Bearer YOUR_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "MODEL_ID_FROM_STEP_3",
        "messages": [
          {"role": "user", "content": "What is the capital of France?"}
        ]
      }'
    ```

    ```json theme={null}
    {
      "id": "chatcmpl-abc123",
      "object": "chat.completion",
      "choices": [
        {
          "index": 0,
          "message": {
            "role": "assistant",
            "content": "The capital of France is Paris."
          },
          "finish_reason": "stop"
        }
      ],
      "usage": {
        "prompt_tokens": 14,
        "completion_tokens": 8,
        "total_tokens": 22
      }
    }
    ```
  </Step>

  <Step title="Stream a Response">
    Enable streaming to receive tokens as they're generated:

    ```bash theme={null}
    curl -X POST https://{BASE_URL}/v1/chat/completions \
      -H "Authorization: Bearer YOUR_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "MODEL_ID",
        "messages": [
          {"role": "user", "content": "Write a haiku about AI"}
        ],
        "stream": true
      }'
    ```

    ```
    data: {"id":"chatcmpl-abc","choices":[{"delta":{"role":"assistant"},"index":0}]}

    data: {"id":"chatcmpl-abc","choices":[{"delta":{"content":"Silicon"},"index":0}]}

    data: {"id":"chatcmpl-abc","choices":[{"delta":{"content":" dreams"},"index":0}]}

    data: [DONE]
    ```
  </Step>

  <Step title="Check Backend Capabilities">
    See which features each backend supports:

    ```bash theme={null}
    curl https://{BASE_URL}/v1/capabilities \
      -H "Authorization: Bearer YOUR_TOKEN"
    ```

    This returns which backends support chat, embeddings, vision, tool calling, and streaming.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    Your token is missing, expired, or invalid. Re-authenticate with `POST /v1/auth/login` or check your PAT hasn't been revoked.
  </Accordion>

  <Accordion title="403 Forbidden">
    Your token doesn't have the required scope. Check the scopes assigned to your PAT with `GET /v1/api-tokens/scopes`.
  </Accordion>

  <Accordion title="404 Not Found">
    Check the endpoint URL and ensure `{BASE_URL}` is correct. All API endpoints use the `/v1/` prefix.
  </Accordion>

  <Accordion title="409 Conflict">
    The model doesn't support the requested capability (e.g., vision on a text-only model). Check capabilities with `GET /v1/capabilities`.
  </Accordion>

  <Accordion title="429 Rate Limited">
    Too many requests. Wait and retry with exponential backoff.
  </Accordion>
</AccordionGroup>

## What's Next?

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/guides/authentication">
    JWT vs PAT, SSO, token refresh, and security best practices.
  </Card>

  <Card title="API Tokens" icon="lock" href="/guides/api-tokens">
    Create scoped tokens for programmatic access.
  </Card>

  <Card title="Developer Guide" icon="book-open" href="/guides/developer-guide">
    Complete endpoint reference with all API areas.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Full auto-generated API documentation.
  </Card>
</CardGroup>
