# Quickstart

### 1. Register & Fund

Register at [cortecs.ai](https://cortecs.ai) and follow these steps to set up your account:

* Fill in your billing address on the [settings page](https://cortecs.ai/userArea/userProfile) and press **Save**.&#x20;
* Enter your credit card details.&#x20;
* Top up your account balance.&#x20;
* Generate an **API key**.

{% hint style="warning" %}
If your balance reaches zero, your requests will fail. To avoid this, use **Auto top-up** to set an amount that is automatically transferred when your balance falls below a specified threshold.
{% endhint %}

### 2. Choose a Model

Browse the [**Model Catalog**](https://cortecs.ai/serverlessModels) and select the model that fits your use case. Once you’re confident with the model's performance, you can proceed to obtain your access token and start sending requests via the API.

### 3. Send Your First Request

Sky Inference supports OpenAI-compatible calls. Here's are some usage examples:

{% tabs %}
{% tab title="Python" %}

```python
from openai import OpenAI

client = OpenAI(
  base_url="https://api.cortecs.ai/v1/",
  api_key="<API_KEY>",
)

completion = client.chat.completions.create(
  model="<MODEL_NAME>",
  messages=[
    {
      "role": "user",
      "content": "Tell me a joke."
    }
  ],
  extra_body={
    "preference": "balanced"
  }
)

print(completion.choices[0].message.content)
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
import OpenAI from "openai";

const openai = new OpenAI({
    baseURL: 'https://api.cortecs.ai/v1',
    apiKey: '<API_KEY>'
});

const completion = await openai.chat.completions.create({
  model: "<MODEL_NAME>",
  messages: [
    {
      role: "user",
      content: "Tell me a joke.",
    }
  ],
  extra_body: {
    "preference": "balanced"
  }
});

console.log(completion.choices[0].message.content);
```

{% endtab %}

{% tab title="Curl" %}

```bash
curl 'https://api.cortecs.ai/v1/chat/completions' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer <API_KEY>' \
    -d '{
      "model": "<MODEL_NAME>",
      "messages": [
        { "role": "user", "content": "Tell me a joke." }
      ],
      "preference": "balanced"
    }'
```

{% endtab %}
{% endtabs %}

> When using the OpenAI compatible wrapper, **router** specific parameters need to be passed inside the `extra_body` parameter (eg. `preference` and `allowed_providers`). Find out more about supported parameters [here](/usage/advanced-usage.md#parameter-handling).

> Tip: Set `"preference"` to `"speed"`, `"cost"` or `"balanced"` to control routing behavior.

➡️ For more details on how routing and preferences work, check the [next chapter](/usage/advanced-usage.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cortecs.ai/quickstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
