Zum Hauptinhalt springen
POST
/
v1
/
chat
/
completions
Claude Chat Completions
curl --request POST \
  --url https://api.acedata.cloud/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "claude-sonnet-4-6",
  "messages": [
    {
      "role": "user",
      "content": "<string>"
    }
  ],
  "n": 1,
  "stream": false,
  "max_tokens": 123,
  "temperature": 1,
  "response_format": {
    "type": "json_object"
  }
}
'
{
  "id": "<string>",
  "model": "<string>",
  "object": "chat.completion",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "assistant",
        "content": "<string>"
      },
      "finish_reason": "stop"
    }
  ],
  "created": 123,
  "system_fingerprint": "<string>"
}

Autorisierungen

Authorization
string
header
erforderlich

Header

accept
enum<string>

Specifies the format of the response from the server.

Verfügbare Optionen:
application/json

Body

application/json
model
enum<string>
erforderlich

ID of the model to use.

Verfügbare Optionen:
claude-sonnet-4-6,
claude-opus-4-6,
claude-opus-4-5-20251101,
claude-haiku-4-5-20251001,
claude-sonnet-4-5-20250929,
claude-opus-4-1-20250805,
claude-sonnet-4-20250514,
claude-opus-4-20250514,
claude-3-7-sonnet-20250219,
claude-3-5-sonnet-20241022,
claude-3-5-haiku-20241022,
claude-3-5-sonnet-20240620,
claude-3-haiku-20240307,
claude-3-sonnet-20240229,
claude-3-opus-20240229
Beispiel:

"claude-sonnet-4-6"

messages
object[]
erforderlich

A list of messages comprising the conversation so far.

Minimum array length: 1
n
number | null
Standard:1

How many chat completion choices to generate for each input message.

Erforderlicher Bereich: 1 <= x <= 128
Beispiel:

1

stream
boolean | null
Standard:false

If set, partial message deltas will be sent, like in ChatGPT.

max_tokens
number | null

The maximum number of tokens that can be generated in the chat completion.

temperature
number | null
Standard:1

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

Erforderlicher Bereich: 0 <= x <= 2
Beispiel:

1

response_format
object

An object specifying the format that the model must output. If not specified, the model will output text.

Antwort

OK, the request was successful.

Represents a chat completion response returned by model, based on the provided input.

id
string
erforderlich

A unique identifier for the chat completion.

model
string
erforderlich

The model used for the chat completion.

object
enum<string>
erforderlich

The object type, which is always chat.completion.

Verfügbare Optionen:
chat.completion
choices
object[]
erforderlich

A list of chat completion choices. Can be more than one if n is greater than 1.

created
number
erforderlich

The Unix timestamp (in seconds) of when the chat completion was created.

system_fingerprint
string

This fingerprint represents the backend configuration that the model runs with.

Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.