チャット補完を作成
curl --request POST \
--url https://apiany.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.4",
"messages": [
{
"role": "user",
"content": "Write a concise product tagline for APIAny.AI."
}
],
"temperature": 0.7
}
'import requests
url = "https://apiany.ai/v1/chat/completions"
payload = {
"model": "gpt-5.4",
"messages": [
{
"role": "user",
"content": "Write a concise product tagline for APIAny.AI."
}
],
"temperature": 0.7
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-5.4',
messages: [{role: 'user', content: 'Write a concise product tagline for APIAny.AI.'}],
temperature: 0.7
})
};
fetch('https://apiany.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiany.ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'gpt-5.4',
'messages' => [
[
'role' => 'user',
'content' => 'Write a concise product tagline for APIAny.AI.'
]
],
'temperature' => 0.7
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiany.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"gpt-5.4\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Write a concise product tagline for APIAny.AI.\"\n }\n ],\n \"temperature\": 0.7\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiany.ai/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-5.4\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Write a concise product tagline for APIAny.AI.\"\n }\n ],\n \"temperature\": 0.7\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiany.ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gpt-5.4\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Write a concise product tagline for APIAny.AI.\"\n }\n ],\n \"temperature\": 0.7\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"input_tokens": 123,
"output_tokens": 123,
"cached_input_tokens": 123
}
}{
"error": {
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}Chat
チャット補完を作成
OpenAI 互換の Chat Completions エンドポイント。現在は非ストリーミング呼び出しが中心です。
POST
/
v1
/
chat
/
completions
チャット補完を作成
curl --request POST \
--url https://apiany.ai/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-5.4",
"messages": [
{
"role": "user",
"content": "Write a concise product tagline for APIAny.AI."
}
],
"temperature": 0.7
}
'import requests
url = "https://apiany.ai/v1/chat/completions"
payload = {
"model": "gpt-5.4",
"messages": [
{
"role": "user",
"content": "Write a concise product tagline for APIAny.AI."
}
],
"temperature": 0.7
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'gpt-5.4',
messages: [{role: 'user', content: 'Write a concise product tagline for APIAny.AI.'}],
temperature: 0.7
})
};
fetch('https://apiany.ai/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiany.ai/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'gpt-5.4',
'messages' => [
[
'role' => 'user',
'content' => 'Write a concise product tagline for APIAny.AI.'
]
],
'temperature' => 0.7
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiany.ai/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"gpt-5.4\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Write a concise product tagline for APIAny.AI.\"\n }\n ],\n \"temperature\": 0.7\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiany.ai/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-5.4\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Write a concise product tagline for APIAny.AI.\"\n }\n ],\n \"temperature\": 0.7\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiany.ai/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"gpt-5.4\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Write a concise product tagline for APIAny.AI.\"\n }\n ],\n \"temperature\": 0.7\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"input_tokens": 123,
"output_tokens": 123,
"cached_input_tokens": 123
}
}{
"error": {
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}{
"error": {
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ボディ
application/json
例:
"gpt-5.4"
Show child attributes
Show child attributes
サンプリング温度。
必須範囲:
0 <= x <= 2核サンプリングの累積確率。
必須範囲:
0 <= x <= 1max_completion_tokens の非推奨互換エイリアスです。APIAny は選択された上流が新しいフィールドを必要とする場合のみ変換します。
必須範囲:
x >= 1思考過程と最終回答を合わせた最大トークン数です。Kimi K3 の既定値は 131072、上限は 1048576 です。
必須範囲:
1 <= x <= 1048576Kimi K3 の思考強度です。K3 は常に思考し、現在は max のみをサポートします。
利用可能なオプション:
max 最大 4 個の停止シーケンス。
生成する候補数。
必須範囲:
x >= 1必須範囲:
-2 <= x <= 2必須範囲:
-2 <= x <= 2できる限り再現可能なサンプリングシード。
JSON オブジェクトまたは JSON Schema 出力を強制します(例: { "type": "json_object" })。
モデルが呼び出せるツール/関数の宣言。
ツール選択: 'auto' | 'none' | 'required' | { type: 'function', function: { name } }。
必須範囲:
0 <= x <= 20リスク監査のためのエンドユーザー識別子。
true の場合、増分を SSE でストリーミング返却します(OpenAI chat.completion.chunk)。'data: [DONE]' で終了します。
⌘I