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

# चैट कंप्लीशन

> C# SDK से /chat/completions call करें।

**Method**: `client.GenerateText(...)` या `client.CreateChatCompletion(...)`

### उदाहरण

```csharp theme={null}
using PhaseoSdk;

var client = new Phaseo(apiKey);
var response = await client.GenerateText(new Dictionary<string, object>
{
    ["model"] = "openai/gpt-5-nano",
    ["messages"] = new[]
    {
        new Dictionary<string, object>
        {
            ["role"] = "user",
            ["content"] = "Write a limerick about lighthouses."
        }
    }
});
```

### मुख्य parameters

* `model` (आवश्यक): लक्ष्य मॉडल ID।
* `messages` (आवश्यक): `system|user|assistant|tool` भूमिकाओं वाले क्रमबद्ध संदेश; सामग्री पाठ या हिस्सों में हो सकती है।
* नमूना चयन: `temperature` (0–2), `top_p` (0–1), `top_k` (>=1), `seed` (वैकल्पिक पूर्णांक)।
* लंबाई/दंड: `max_output_tokens` (पूर्णांक), `presence_penalty` और `frequency_penalty` (-2 से 2), `stop` (string|string\[])।
* टूल: `tools` (परिभाषाएँ), `tool_choice` (auto/none/विशिष्ट टूल), `max_tool_calls` (पूर्णांक), `parallel_tool_calls` (बूलियन)।
* लॉग प्रायिकताएँ: `logprobs` (बूलियन), `top_logprobs` (0–20)।
* आउटपुट: `response_format` (json/text), `meta` (पास-थ्रू ऑब्जेक्ट), `stream` (बूलियन), `service_tier`।
* Gateway के अतिरिक्त विकल्प: `usage` (उपयोग आँकड़े माँगने के लिए बूलियन), `meta` (मेटा ब्लॉक शामिल करने के लिए बूलियन)।

### रिटर्न मान

`ChatCompletionsResponse`

```json theme={null}
{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "gpt-3.5-turbo-0125",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello there, how may I assist you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 12,
    "total_tokens": 21
  }
}
```


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