# Chat API

* The Chat API currently do not support the following parameters:
  * **model**, **temperate**, **max\_tokens**
  * **stream** will be set to **false** ( xNomad Agents currently do not support streaming

## POST /v1/chat/completions

> Generates a model response for the given chat conversation.<br>

```json
{"openapi":"3.0.0","info":{"title":"xNomad AI API","version":"1.0.0"},"servers":[{"url":"https://core.xnomad.fun"}],"security":[{"ApiKeyAuth":[]}],"paths":{"/v1/chat/completions":{"post":{"operationId":"createChatCompletion","tags":["Chat"],"description":"Generates a model response for the given chat conversation.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messages"],"properties":{"messages":{"type":"array","description":"A list of messages comprising the conversation so far.","minItems":1,"items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant"],"description":"The role of the message author."},"content":{"type":"string","description":"The content of the message."}}}},"model":{"type":"string","description":"ID of the model to use."},"temperature":{"type":"number","description":"What sampling temperature to use, between 0 and 2.","default":1,"maximum":2,"nullable":true},"max_tokens":{"type":"integer","description":"The maximum number of tokens to generate in the chat completion.","default":1,"minimum":1,"nullable":true},"stream":{"type":"boolean","description":"If set, partial message deltas will be sent.","default":false,"nullable":true}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["id","object","created","choices"],"properties":{"id":{"type":"string","description":"A unique identifier for the chat completion."},"object":{"type":"string","description":"The object type, which is always 'chat.completion'.","enum":["chat.completion"]},"created":{"type":"integer","description":"The Unix timestamp (in seconds) of when the chat completion was created."},"model":{"type":"string","description":"The model used for the chat completion."},"choices":{"type":"array","description":"A list of chat completion choices.","items":{"type":"object","required":["index","message"],"properties":{"index":{"type":"integer","description":"The index of the choice in the list."},"message":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","description":"The role of the author of this message.","enum":["assistant"]},"content":{"type":"string","description":"The content of the message."}}},"finish_reason":{"type":"string","description":"The reason the model stopped generating tokens.","enum":["stop","length","content_filter","function_call","tool_calls"]}}}},"usage":{"type":"object","description":"Usage statistics for the completion request.","properties":{"prompt_tokens":{"type":"integer","description":"Number of tokens in the prompt."},"completion_tokens":{"type":"integer","description":"Number of tokens in the generated completion."},"total_tokens":{"type":"integer","description":"Total number of tokens used in the request."}}}}}}}}}}}}}
```
