cURL
curl --request POST \
--url https://www.anyfast.ai/v1/responses \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-6-luna",
"input": "Classify this support ticket and return a short routing reason.",
"reasoning": {"effort":"medium","summary":"auto"},
"max_output_tokens": 1024
}'import requests
url = "https://www.anyfast.ai/v1/responses"
payload = {
"model": "gpt-6-luna",
"input": "<string>",
"instructions": "<string>",
"reasoning": { "effort": "medium" },
"max_output_tokens": 64000,
"text": {},
"tools": [
{
"type": "<string>",
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": True
}
],
"stream": False,
"prompt_cache_key": "<string>",
"prompt_cache_options": { "ttl": "30m" },
"include": ["<string>"]
}
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-6-luna',
input: '<string>',
instructions: '<string>',
reasoning: {effort: 'medium'},
max_output_tokens: 64000,
text: {},
tools: [
{
type: '<string>',
name: '<string>',
description: '<string>',
parameters: {},
strict: true
}
],
stream: false,
prompt_cache_key: '<string>',
prompt_cache_options: {ttl: '30m'},
include: ['<string>']
})
};
fetch('https://www.anyfast.ai/v1/responses', 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://www.anyfast.ai/v1/responses",
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-6-luna',
'input' => '<string>',
'instructions' => '<string>',
'reasoning' => [
'effort' => 'medium'
],
'max_output_tokens' => 64000,
'text' => [
],
'tools' => [
[
'type' => '<string>',
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => true
]
],
'stream' => false,
'prompt_cache_key' => '<string>',
'prompt_cache_options' => [
'ttl' => '30m'
],
'include' => [
'<string>'
]
]),
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://www.anyfast.ai/v1/responses"
payload := strings.NewReader("{\n \"model\": \"gpt-6-luna\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"max_output_tokens\": 64000,\n \"text\": {},\n \"tools\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n }\n ],\n \"stream\": false,\n \"prompt_cache_key\": \"<string>\",\n \"prompt_cache_options\": {\n \"ttl\": \"30m\"\n },\n \"include\": [\n \"<string>\"\n ]\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://www.anyfast.ai/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-6-luna\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"max_output_tokens\": 64000,\n \"text\": {},\n \"tools\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n }\n ],\n \"stream\": false,\n \"prompt_cache_key\": \"<string>\",\n \"prompt_cache_options\": {\n \"ttl\": \"30m\"\n },\n \"include\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1/responses")
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-6-luna\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"max_output_tokens\": 64000,\n \"text\": {},\n \"tools\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n }\n ],\n \"stream\": false,\n \"prompt_cache_key\": \"<string>\",\n \"prompt_cache_options\": {\n \"ttl\": \"30m\"\n },\n \"include\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "response",
"model": "gpt-6-luna",
"status": "queued",
"output": [
{}
],
"output_text": "<string>",
"usage": {},
"error": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}OpenAI
gpt-6-luna
通过 AnyFast 创建 GPT-6 Luna Responses 和 Chat Completions 响应。
POST
/
v1
/
responses
cURL
curl --request POST \
--url https://www.anyfast.ai/v1/responses \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-6-luna",
"input": "Classify this support ticket and return a short routing reason.",
"reasoning": {"effort":"medium","summary":"auto"},
"max_output_tokens": 1024
}'import requests
url = "https://www.anyfast.ai/v1/responses"
payload = {
"model": "gpt-6-luna",
"input": "<string>",
"instructions": "<string>",
"reasoning": { "effort": "medium" },
"max_output_tokens": 64000,
"text": {},
"tools": [
{
"type": "<string>",
"name": "<string>",
"description": "<string>",
"parameters": {},
"strict": True
}
],
"stream": False,
"prompt_cache_key": "<string>",
"prompt_cache_options": { "ttl": "30m" },
"include": ["<string>"]
}
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-6-luna',
input: '<string>',
instructions: '<string>',
reasoning: {effort: 'medium'},
max_output_tokens: 64000,
text: {},
tools: [
{
type: '<string>',
name: '<string>',
description: '<string>',
parameters: {},
strict: true
}
],
stream: false,
prompt_cache_key: '<string>',
prompt_cache_options: {ttl: '30m'},
include: ['<string>']
})
};
fetch('https://www.anyfast.ai/v1/responses', 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://www.anyfast.ai/v1/responses",
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-6-luna',
'input' => '<string>',
'instructions' => '<string>',
'reasoning' => [
'effort' => 'medium'
],
'max_output_tokens' => 64000,
'text' => [
],
'tools' => [
[
'type' => '<string>',
'name' => '<string>',
'description' => '<string>',
'parameters' => [
],
'strict' => true
]
],
'stream' => false,
'prompt_cache_key' => '<string>',
'prompt_cache_options' => [
'ttl' => '30m'
],
'include' => [
'<string>'
]
]),
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://www.anyfast.ai/v1/responses"
payload := strings.NewReader("{\n \"model\": \"gpt-6-luna\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"max_output_tokens\": 64000,\n \"text\": {},\n \"tools\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n }\n ],\n \"stream\": false,\n \"prompt_cache_key\": \"<string>\",\n \"prompt_cache_options\": {\n \"ttl\": \"30m\"\n },\n \"include\": [\n \"<string>\"\n ]\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://www.anyfast.ai/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"gpt-6-luna\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"max_output_tokens\": 64000,\n \"text\": {},\n \"tools\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n }\n ],\n \"stream\": false,\n \"prompt_cache_key\": \"<string>\",\n \"prompt_cache_options\": {\n \"ttl\": \"30m\"\n },\n \"include\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1/responses")
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-6-luna\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"reasoning\": {\n \"effort\": \"medium\"\n },\n \"max_output_tokens\": 64000,\n \"text\": {},\n \"tools\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": {},\n \"strict\": true\n }\n ],\n \"stream\": false,\n \"prompt_cache_key\": \"<string>\",\n \"prompt_cache_options\": {\n \"ttl\": \"30m\"\n },\n \"include\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "response",
"model": "gpt-6-luna",
"status": "queued",
"output": [
{}
],
"output_text": "<string>",
"usage": {},
"error": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}带推理的工具调用请使用 Responses API。Chat Completions 函数调用要求
reasoning_effort: "none"。解析 Responses API 原始 JSON 时,应从
output[].content[].text 读取生成文本。部分官方 SDK 会提供 output_text 便利属性,但原始 HTTP 响应可能不包含该字段。授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
推理强度不是 none 时,请移除 temperature、top_p 和 top_logprobs。
可用选项:
gpt-6-luna 文本或有序输入项,包括文本和图像内容。
Show child attributes
Show child attributes
可见输出和推理 token 的最大数量。
必填范围:
1 <= x <= 128000文本详细程度或结构化输出配置。
Show child attributes
Show child attributes
可用选项:
none, auto, required Show child attributes
Show child attributes
推理强度不是 none 时,不要请求 message.output_text.logprobs。
响应
响应创建成功。
此页面对您有帮助吗?