Chat Completion

POSThttps://zylai-a779.zyllion.network/v1/chat/completions

info

Feel free to use the Zyllion2025 as a test Bearer Token

Generate a chat completion response from the AI model.

  • req: Chat completion request containing messages and model specifications

  • user: Authenticated user information (through HTTP Bearer header)

  • Returns: Full chat response with model output, usage statistics, and cryptographic signature

Request Requirements

  • Must include non-empty list of messages

  • Must specify a model

  • Supports multiple message formats (system, user, assistant)

Response Components

  • Model-generated text completion

  • Token usage metrics

  • Cryptographically signed response for verification

Processing Steps

  1. Validate input request parameters

  2. Prepare messages for model processing

  3. Generate AI model response

  4. Track and update token usage

  5. Cryptographically sign the response

Potential HTTP Errors

  • 400 Bad Request:

    • Missing messages list

    • No model specified

  • 500 Internal Server Error:

    • Model fails to generate a response

Request

  • application/json

Responses

  • 200

  • 422

Successful Response

  • application/json

  • Schema

  • curl

  • dart

  • go

  • http

  • java

  • javascript

  • kotlin

  • c

  • nodejs

  • objective-c

  • ocaml

  • php

  • powershell

  • python

  • r

  • ruby

  • rust

  • shell

  • swift

  • HTTPCLIENT

  • RESTSHARP

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://zylai-a779.zyllion.network/v1/chat/completions");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <TOKEN>");
var content = new StringContent("{\n  \"model\": \"meta-llama/Llama-3.1-8B-Instruct\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a helpful assistant\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"What is your name?\"\n    }\n  ],\n  \"temperature\": 0.2,\n  \"top_p\": 0.95,\n  \"max_tokens\": 2048,\n  \"stream\": false,\n  \"zylrag\": {}\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

RequestCollapse all

Send API RequestResponseClear

Click the Send API Request button above and see the response here!

Last updated