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

نمونه درخواست (Chat Completions)

# Required: model, messages (text + optional image_url)
# Optional gateway parameters:
# temperature: optional, default: 1
# max_tokens: optional, default: 1024 — Gateway از max_tokens می‌گیرد؛ برای این مدل به max_completion_tokens نگاشت می‌شود.
# 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.aifoapp.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.aifoapp.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 — Gateway از max_tokens می‌گیرد؛ برای این مدل به max_completion_tokens نگاشت می‌شود.
# 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.aifoapp.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 — Gateway از max_tokens می‌گیرد؛ برای این مدل به max_completion_tokens نگاشت می‌شود.
# 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.aifoapp.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 — Gateway از max_tokens می‌گیرد؛ برای این مدل به max_completion_tokens نگاشت می‌شود.
# 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);

نمونه درخواست (Responses API)

این مدل علاوه بر Chat Completions از POST /v1/responses پشتیبانی می‌کند. جزئیات در راهنمای Responses.

# Required: model, input — input_text + input_file.file_id (upload via /v1/files)
# Stateless: omit store or store:false; previous_response_id unsupported
curl https://api.aifoapp.ir/v1/responses \
  -H "Authorization: Bearer aifo_sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.2-chat-latest","input":[{"role":"user","content":[{"type":"input_text","text":"لطفاً تصویری از یک گربه بفرستید و بپرسید: \"این گربه چه نوعی است؟\""},{"type":"input_file","file_id":"file_..."}]}]}'
from openai import OpenAI

# Responses via AiFO — change base_url, api_key, model only
client = OpenAI(base_url="https://api.aifoapp.ir/v1", api_key="aifo_sk_live_YOUR_API_KEY")
resp = client.responses.create(
    model="gpt-5.2-chat-latest",
    input=[
  {
    "role": "user",
    "content": [
      {
        "type": "input_text",
        "text": "لطفاً تصویری از یک گربه بفرستید و بپرسید: \"این گربه چه نوعی است؟\""
      },
      {
        "type": "input_file",
        "file_id": "file_..."
      }
    ]
  }
],
)
print(resp.output_text)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.aifoapp.ir/v1",
  apiKey: "aifo_sk_live_YOUR_API_KEY",
});

const resp = await client.responses.create({
  model: "gpt-5.2-chat-latest",
  input: [
  {
    "role": "user",
    "content": [
      {
        "type": "input_text",
        "text": "لطفاً تصویری از یک گربه بفرستید و بپرسید: \"این گربه چه نوعی است؟\""
      },
      {
        "type": "input_file",
        "file_id": "file_..."
      }
    ]
  }
],
});
console.log(resp.output_text);
const OpenAI = require("openai");

const client = new OpenAI({
  baseURL: "https://api.aifoapp.ir/v1",
  apiKey: "aifo_sk_live_YOUR_API_KEY",
});

async function main() {
  const resp = await client.responses.create({
    model: "gpt-5.2-chat-latest",
    input: [
  {
    "role": "user",
    "content": [
      {
        "type": "input_text",
        "text": "لطفاً تصویری از یک گربه بفرستید و بپرسید: \"این گربه چه نوعی است؟\""
      },
      {
        "type": "input_file",
        "file_id": "file_..."
      }
    ]
  }
],
  });
  console.log(resp.output_text);
}
main();

پارامترها

ورودی‌ها

  • متن: از طریق messages یا input (بسته به endpoint)
  • تصویر (Chat): image_url داخل messages
  • Responses: POST /v1/responses — ورودی string یا input_text / input_image / input_file (با AiFO file_id). Stateless؛ store: true و previous_response_id پشتیبانی نمی‌شوند.
  • تصویر (Responses): input_image با image_url
  • فایل (Responses): input_file با AiFO file_id (قبل از ارسال به Gateway به file_data تبدیل می‌شود)

فیلدهای الزامی body: model، messages

پارامترها

نام نوع الزامی/اختیاری پیش‌فرض توضیح
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

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 از OpenAI (ChatGPT) برای تولید پاسخ‌های متنی و تصویری به ورودی‌های چندرسانه‌ای طراحی شده است. این مدل با قابلیت‌های پیشرفته در پردازش زبان طبیعی و پشتیبانی از ورودی‌های تصویری، امکان تعاملات پویا و غنی را فراهم می‌کند.

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

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

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