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

# First API Call

ScitiX provides a unified Model API platform for developers and enterprises. It is compatible with OpenAI-style interfaces and supports large language models, vision/multimodal models, code generation models, and reasoning models, all available with pay-as-you-go billing.

You can create an API key and call the model through REST or the OpenAI-compatible SDK.

## 1. Create an API key

1. Go to the [API Keys](https://console.scitix.ai/model-inference/api_keys) page and click **Create API Key**.
2. Give the key a recognizable name, then copy it and store it in an environment variable.

   ```bash theme={null}
   export API_KEY="YOUR_API_KEY"
   ```

Each key shows its status, last-used time, and monthly usage in the list. For quotas, rate limits, or pausing a key, see the [API Keys guide](/model-inference/usage/api-keys).

## 2. Call a model

### Call via REST

Use standard HTTP requests. The following example sends a streaming Chat Completions request:

```bash theme={null}
curl -N https://api.scitix.ai/model-api/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3-32B",
    "stream": true,
    "messages": [
      {"role": "user", "content": "What new opportunities might reasoning models bring to the market?"}
    ]
  }'
```

The example above prints the raw streaming response. Because the API uses Server-Sent Events (SSE), you will see multiple `data: {...}` JSON lines. To display only the concatenated text content, you can pipe the response through `jq`:

<Tip>
  This script requires `jq` to be installed on your machine, for example with `brew install jq` on macOS or `apt-get install jq` on Debian/Ubuntu.
</Tip>

```bash theme={null}
curl -N https://api.scitix.ai/model-api/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen/Qwen3-32B",
    "stream": true,
    "messages": [{"role": "user", "content": "What new opportunities might reasoning models bring to the market?"}]
  }' 2>/dev/null | while IFS= read -r line; do
  if [[ "$line" == data:* ]]; then
    json="${line#data: }"
    if [[ "$json" != "[DONE]" ]]; then
      echo -n "$(echo "$json" | jq -r '.choices[0].delta.content // empty')"
    fi
  fi
done
echo
```

Set `stream` to `false` if you prefer to receive the full result in a single response. For other tasks, such as text-to-image, refer to the documentation or the model detail page for the corresponding APIs and parameters.

### Call via the OpenAI-compatible Python SDK

The platform is compatible with the official OpenAI Python SDK. Install Python 3.7.1+ and run:

```bash theme={null}
pip install --upgrade openai
```

Example with streaming output and `reasoning` support:

```python theme={null}
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.getenv("API_KEY") or "YOUR_API_KEY",
    base_url="https://api.scitix.ai/model-api"
)

response = client.chat.completions.create(
    model="Qwen/Qwen3-32B",
    messages=[
        {"role": "user", "content": "What new opportunities might reasoning models bring to the market?"}
    ],
    stream=True
)

for chunk in response:
    if not chunk.choices:
        continue
    delta = chunk.choices[0].delta
    if getattr(delta, "content", None):
        print(delta.content, end="", flush=True)
    if getattr(delta, "reasoning", None):
        print(delta.reasoning, end="", flush=True)
```

If you do not need streaming, remove `stream=True` and read `response.choices[0].message.content`. Choose the appropriate model and parameters from the [Models](https://console.scitix.ai/model-inference/models) page based on your scenario.

## 3. Monitor usage

On the [Home](https://console.scitix.ai/model-inference/home) page, you can review total tokens, API requests, and throughput, with charts filtered by metric and model.

Use the time presets (**24 hours**, **7 days**, **30 days**) for a quick look on Home. For custom date ranges and deeper analysis, open [Metrics](https://console.scitix.ai/model-inference/metrics). See the [View Usage guide](/model-inference/usage/view-usage) for details on filtering and reading the Metrics charts.
