# 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](https://docs.cortecs.ai/advanced-usage#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](https://docs.cortecs.ai/advanced-usage).
