AI model event — OpenAI compatible (METERED)
curl --request POST \
--url https://app.profy.cn/openapi/v1/events/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-chat",
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"stream": true,
"temperature": 123,
"max_tokens": 123,
"top_p": 123,
"frequency_penalty": 123,
"presence_penalty": 123,
"stop": "<string>"
}
'import requests
url = "https://app.profy.cn/openapi/v1/events/chat"
payload = {
"model": "deepseek-chat",
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"stream": True,
"temperature": 123,
"max_tokens": 123,
"top_p": 123,
"frequency_penalty": 123,
"presence_penalty": 123,
"stop": "<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: 'deepseek-chat',
messages: [{role: '<string>', content: '<string>'}],
stream: true,
temperature: 123,
max_tokens: 123,
top_p: 123,
frequency_penalty: 123,
presence_penalty: 123,
stop: '<string>'
})
};
fetch('https://app.profy.cn/openapi/v1/events/chat', 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://app.profy.cn/openapi/v1/events/chat",
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' => 'deepseek-chat',
'messages' => [
[
'role' => '<string>',
'content' => '<string>'
]
],
'stream' => true,
'temperature' => 123,
'max_tokens' => 123,
'top_p' => 123,
'frequency_penalty' => 123,
'presence_penalty' => 123,
'stop' => '<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://app.profy.cn/openapi/v1/events/chat"
payload := strings.NewReader("{\n \"model\": \"deepseek-chat\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"top_p\": 123,\n \"frequency_penalty\": 123,\n \"presence_penalty\": 123,\n \"stop\": \"<string>\"\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://app.profy.cn/openapi/v1/events/chat")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"deepseek-chat\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"top_p\": 123,\n \"frequency_penalty\": 123,\n \"presence_penalty\": 123,\n \"stop\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.profy.cn/openapi/v1/events/chat")
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\": \"deepseek-chat\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"top_p\": 123,\n \"frequency_penalty\": 123,\n \"presence_penalty\": 123,\n \"stop\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyEvents
AI 模型调用
Proxy chat completions through a model provider with automatic token billing.
POST
/
openapi
/
v1
/
events
/
chat
AI model event — OpenAI compatible (METERED)
curl --request POST \
--url https://app.profy.cn/openapi/v1/events/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-chat",
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"stream": true,
"temperature": 123,
"max_tokens": 123,
"top_p": 123,
"frequency_penalty": 123,
"presence_penalty": 123,
"stop": "<string>"
}
'import requests
url = "https://app.profy.cn/openapi/v1/events/chat"
payload = {
"model": "deepseek-chat",
"messages": [
{
"role": "<string>",
"content": "<string>"
}
],
"stream": True,
"temperature": 123,
"max_tokens": 123,
"top_p": 123,
"frequency_penalty": 123,
"presence_penalty": 123,
"stop": "<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: 'deepseek-chat',
messages: [{role: '<string>', content: '<string>'}],
stream: true,
temperature: 123,
max_tokens: 123,
top_p: 123,
frequency_penalty: 123,
presence_penalty: 123,
stop: '<string>'
})
};
fetch('https://app.profy.cn/openapi/v1/events/chat', 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://app.profy.cn/openapi/v1/events/chat",
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' => 'deepseek-chat',
'messages' => [
[
'role' => '<string>',
'content' => '<string>'
]
],
'stream' => true,
'temperature' => 123,
'max_tokens' => 123,
'top_p' => 123,
'frequency_penalty' => 123,
'presence_penalty' => 123,
'stop' => '<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://app.profy.cn/openapi/v1/events/chat"
payload := strings.NewReader("{\n \"model\": \"deepseek-chat\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"top_p\": 123,\n \"frequency_penalty\": 123,\n \"presence_penalty\": 123,\n \"stop\": \"<string>\"\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://app.profy.cn/openapi/v1/events/chat")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"deepseek-chat\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"top_p\": 123,\n \"frequency_penalty\": 123,\n \"presence_penalty\": 123,\n \"stop\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.profy.cn/openapi/v1/events/chat")
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\": \"deepseek-chat\",\n \"messages\": [\n {\n \"role\": \"<string>\",\n \"content\": \"<string>\"\n }\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"top_p\": 123,\n \"frequency_penalty\": 123,\n \"presence_penalty\": 123,\n \"stop\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body授权
OAuth2 access token issued via POST /oauth/token
请求体
application/json
响应
Chat completion response (JSON or SSE stream)
⌘I

