POST
/
v1
/
chat
/
completions
import { AtomaSDK } from "atoma-sdk";

const atomaSDK = new AtomaSDK({
  bearerAuth: process.env["ATOMASDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const completion = await atomaSDK.chat.create({
    messages: [
      {"role": "developer", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello!"}
    ],
    model: "meta-llama/Llama-3.3-70B-Instruct"
  });

  console.log(completion.choices[0]);
}

run();
{
  "choices": "[{\"index\": 0, \"message\": {\"role\": \"assistant\", \"content\": \"Hello! How can you help me today?\"}, \"finish_reason\": null, \"stop_reason\": null}]",
  "created": 1677652288,
  "id": "chatcmpl-123",
  "model": "meta-llama/Llama-3.3-70B-Instruct",
  "object": "chat.completion",
  "service_tier": "auto",
  "system_fingerprint": "fp_44709d6fcb",
  "usage": null
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Represents the create chat completion request.

This is used to represent the create chat completion request in the chat completion request. It can be either a chat completion or a chat completion stream. Represents the chat completion request.

This is used to represent the chat completion request in the chat completion request. It can be either a chat completion or a chat completion stream.

Response

200
application/json

Chat completions

Represents the chat completion response.

This is used to represent the chat completion response in the chat completion request. It can be either a chat completion or a chat completion stream.