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

# cURL / Python / Node.js

> Resmi OpenAI kütüphaneleriyle API'yi doğrudan çağır

Her resmi OpenAI kütüphanesi çalışır; yalnızca `base_url` değişir. Örnekler `gpt-5.6-sol` kullanır; Astra paketi için `gpt-astra` kullan.

## Chat Completions

<CodeGroup>
  ```bash cURL theme={null}
  curl https://gpt.teamsoclo.site/v1/chat/completions \
    -H "Authorization: Bearer sk-xxx" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "gpt-5.6-sol",
      "messages": [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain closures in JavaScript"}
      ]
    }'
  ```

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

  client = OpenAI(
      api_key="sk-xxx",
      base_url="https://gpt.teamsoclo.site/v1",
  )

  resp = client.chat.completions.create(
      model="gpt-5.6-sol",
      messages=[
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "Explain closures in JavaScript"},
      ],
  )

  print(resp.choices[0].message.content)
  print(resp.usage)
  ```

  ```javascript Node.js theme={null}
  import OpenAI from "openai"

  const client = new OpenAI({
    apiKey: "sk-xxx",
    baseURL: "https://gpt.teamsoclo.site/v1",
  })

  const resp = await client.chat.completions.create({
    model: "gpt-5.6-sol",
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: "Explain closures in JavaScript" },
    ],
  })

  console.log(resp.choices[0].message.content)
  console.log(resp.usage)
  ```
</CodeGroup>

<Warning>
  `base_url` `/v1` içermeli ve `/` ile **bitmemeli**. Kütüphane `/chat/completions`'ı kendisi ekler.
</Warning>

Yanıtlar OpenAI şemasını tam olarak takip eder: `id` `chatcmpl-...`'dur, `usage`'da `prompt_tokens`, `completion_tokens` ve `completion_tokens_details.reasoning_tokens` bulunur. Kota tam olarak `usage.total_tokens` üzerinden ücretlendirilir.

## Responses API

Codex ve daha yeni SDK'lar bu protokolü kullanır. Akıl yürütme ayarı `reasoning.effort`'ta bulunur.

<CodeGroup>
  ```bash cURL theme={null}
  curl https://gpt.teamsoclo.site/v1/responses \
    -H "Authorization: Bearer sk-xxx" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "gpt-5.6-sol",
      "input": "Write a Python function that checks for primes",
      "reasoning": {"effort": "medium"}
    }'
  ```

  ```python Python theme={null}
  resp = client.responses.create(
      model="gpt-5.6-sol",
      input="Write a Python function that checks for primes",
      reasoning={"effort": "medium"},
  )
  print(resp.output_text)
  ```
</CodeGroup>

## Akıl yürütme gücü

Chat Completions ile `reasoning_effort` kullan (`low`, `medium`, `high`). Ayarlanmazsa ağ geçidi `high` kullanır. Basit görevler için token tasarrufu yapmak üzere `low` ayarla:

```python theme={null}
resp = client.chat.completions.create(
    model="gpt-5.6-sol",
    reasoning_effort="low",
    messages=[{"role": "user", "content": "Translate to French: good morning"}],
)
```

<Warning>
  `reasoning_effort` yalnızca Chat Completions içindir. Responses API ile `reasoning: {"effort": ...}` kullan; `/v1/responses`'a `reasoning_effort` göndermek "Unsupported parameter" ile reddedilir.
</Warning>

## Akış

<CodeGroup>
  ```python Python theme={null}
  stream = client.chat.completions.create(
      model="gpt-5.6-sol",
      messages=[{"role": "user", "content": "Write a short paragraph about autumn"}],
      stream=True,
      stream_options={"include_usage": True},
  )

  for chunk in stream:
      if chunk.choices and chunk.choices[0].delta.content:
          print(chunk.choices[0].delta.content, end="", flush=True)
      if chunk.usage:
          print("\n", chunk.usage)
  ```

  ```bash cURL theme={null}
  curl https://gpt.teamsoclo.site/v1/chat/completions \
    -H "Authorization: Bearer sk-xxx" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "gpt-5.6-sol",
      "messages": [{"role": "user", "content": "Write a short paragraph about autumn"}],
      "stream": true,
      "stream_options": {"include_usage": true}
    }'
  ```
</CodeGroup>

<Tip>
  Zor sorularda model ilk tokenden önce bir süre düşünebilir. Bağlantının kesilmemesi için `stream: true` kullan. `stream_options.include_usage`, son parçanın `usage` taşımasını sağlar, böylece kotayı kendin uzlaştırabilirsin.
</Tip>

## Resim gönderme (görü)

Resimler `content` dizisine, yerel dosyalar için genel URL veya base64 olarak gider.

<CodeGroup>
  ```python Image URL theme={null}
  resp = client.chat.completions.create(
      model="gpt-5.6-sol",
      messages=[{
          "role": "user",
          "content": [
              {"type": "text", "text": "What error does this show?"},
              {"type": "image_url", "image_url": {"url": "https://example.com/screenshot.png"}},
          ],
      }],
  )
  print(resp.choices[0].message.content)
  ```

  ```python Local file (base64) theme={null}
  import base64

  with open("screenshot.png", "rb") as f:
      b64 = base64.b64encode(f.read()).decode()

  resp = client.chat.completions.create(
      model="gpt-5.6-sol",
      messages=[{
          "role": "user",
          "content": [
              {"type": "text", "text": "What error does this show?"},
              {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{b64}"}},
          ],
      }],
  )
  print(resp.choices[0].message.content)
  ```
</CodeGroup>

<Warning>
  Resimler boyuta göre token harcar. Tam 4K ekran görüntüsü göndermek yerine ilgili kısma kırp.
</Warning>

## API üzerinden modeller ve kota

```bash theme={null}
# Bu anahtarın çağırabileceği modeller
curl https://gpt.teamsoclo.site/v1/models -H "Authorization: Bearer sk-xxx"

# Kota (eski OpenAI uç noktaları)
curl https://gpt.teamsoclo.site/v1/dashboard/billing/subscription -H "Authorization: Bearer sk-xxx"
curl https://gpt.teamsoclo.site/v1/dashboard/billing/usage -H "Authorization: Bearer sk-xxx"
```

`subscription`, `hard_limit_usd`'de toplamı döndürür; `usage`, `total_usage`'da kullanılanı **sent** cinsinden döndürür (karşılaştırmadan önce 100'e böl). [Kontrol sayfası](https://gpt.teamsoclo.site/check) bunu senin için yapar.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.