AiFO مستندات AiFO
قیمت
Input: 1.75 USD · Output: 14 USD · per_1m_tokens
Context
نامشخص
Endpoint
POST /v1/chat/completions

نمونه درخواست

# Required: model, messages (text + optional image_url)
# Optional gateway parameters:
# temperature: optional, default: 1
# max_tokens: optional, default: 1024
# top_p: optional, default: 1
# frequency_penalty: optional, default: 0
# presence_penalty: optional, default: 0
# image_url in messages: optional (multimodal input)
curl https://api.haftominhonar.ir/v1/chat/completions \
  -H "Authorization: Bearer aifo_sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.2-chat-latest","messages":[{"role":"user","content":[{"type":"text","text":"لطفاً تصویری از یک منظره طبیعی ارسال کنید و درباره تأثیر طبیعت بر آرامش ذهن توضیح دهید."},{"type":"image_url","image_url":{"url":"https://example.com/image.jpg"}}]}],"temperature":1,"max_tokens":1024,"top_p":1,"frequency_penalty":0,"presence_penalty":0}'
import requests

url = "https://api.haftominhonar.ir/v1/chat/completions"
headers = {
    "Authorization": "Bearer aifo_sk_live_YOUR_API_KEY",
    "Content-Type": "application/json",
}
# Required: model, messages
payload = {
  "model": "gpt-5.2-chat-latest",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "لطفاً تصویری از یک منظره طبیعی ارسال کنید و درباره تأثیر طبیعت بر آرامش ذهن توضیح دهید."
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://example.com/image.jpg"
          }
        }
      ]
    }
  ],
  "temperature": 1,
  "max_tokens": 1024,
  "top_p": 1,
  "frequency_penalty": 0,
  "presence_penalty": 0
}


# Optional gateway parameters:
# temperature: optional, default: 1
# max_tokens: optional, default: 1024
# top_p: optional, default: 1
# frequency_penalty: optional, default: 0
# presence_penalty: optional, default: 0
# image_url in messages: optional (multimodal input)

response = requests.post(url, headers=headers, json=payload)
print(response.json())
// Required: model, messages
const response = await fetch("https://api.haftominhonar.ir/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": "Bearer aifo_sk_live_YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "model": "gpt-5.2-chat-latest",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "لطفاً تصویری از یک منظره طبیعی ارسال کنید و درباره تأثیر طبیعت بر آرامش ذهن توضیح دهید."
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://example.com/image.jpg"
          }
        }
      ]
    }
  ],
  "temperature": 1,
  "max_tokens": 1024,
  "top_p": 1,
  "frequency_penalty": 0,
  "presence_penalty": 0
}),
});


# Optional gateway parameters:
# temperature: optional, default: 1
# max_tokens: optional, default: 1024
# top_p: optional, default: 1
# frequency_penalty: optional, default: 0
# presence_penalty: optional, default: 0
# image_url in messages: optional (multimodal input)

const data = await response.json();
console.log(data);
import axios from "axios";

// Required: model, messages
const { data } = await axios.post(
  "https://api.haftominhonar.ir/v1/chat/completions",
  {
  "model": "gpt-5.2-chat-latest",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "لطفاً تصویری از یک منظره طبیعی ارسال کنید و درباره تأثیر طبیعت بر آرامش ذهن توضیح دهید."
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://example.com/image.jpg"
          }
        }
      ]
    }
  ],
  "temperature": 1,
  "max_tokens": 1024,
  "top_p": 1,
  "frequency_penalty": 0,
  "presence_penalty": 0
},
  {
    headers: {
      Authorization: "Bearer aifo_sk_live_YOUR_API_KEY",
      "Content-Type": "application/json",
    },
  },
);


# Optional gateway parameters:
# temperature: optional, default: 1
# max_tokens: optional, default: 1024
# top_p: optional, default: 1
# frequency_penalty: optional, default: 0
# presence_penalty: optional, default: 0
# image_url in messages: optional (multimodal input)

console.log(data);

پارامترها

ورودی‌ها — text/image

پارامترها

نام نوع الزامی/اختیاری پیش‌فرض توضیح
temperature number اختیاری 1 تعیین میزان خلاقیت مدل در تولید پاسخ‌ها.
max_tokens number اختیاری 1024 حداکثر تعداد توکن‌های تولید شده در پاسخ. Gateway از max_tokens می‌گیرد؛ برای این مدل به max_completion_tokens نگاشت می‌شود.
top_p number اختیاری 1 تعیین تنوع پاسخ‌ها با استفاده از نمونه‌گیری هسته‌ای.
frequency_penalty number اختیاری 0 جریمه تکرار کلمات در پاسخ‌ها.
presence_penalty number اختیاری 0 جریمه حضور کلمات خاص در پاسخ‌ها.

فیلدهای الزامی در بدنه

  • model
  • messages

FAQ

قیمت gpt-5.2-chat-latest در AiFO چقدر است؟

قیمت ورودی 1.75 USD و خروجی 14 USD (per_1m_tokens) است.

gpt-5.2-chat-latest برای چه کاربردی مناسب است؟

مدل gpt-5.2-chat-latest یک ابزار پیشرفته برای تولید متن و تعاملات چت است که قابلیت پردازش ورودی‌های متنی و تصویری را دارد. این مدل با پشتیبانی از استریمینگ، امکان تعاملات پویا و همزمان را فراهم می‌کند، اما قابلیت پردازش صوتی ندارد.

چطور این مدل را از API صدا بزنم؟

یک API Key از پنل AiFO بگیرید، model را در body درخواست قرار دهید و درخواست را به gateway ارسال کنید. نمونه cURL و JavaScript در همین صفحه آمده است.

مدل‌های مرتبط