AiFO AiFO مستندات AiFO
قیمت
Input: 0.75 USD · Output: 4.5 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.4-mini","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.4-mini",
  "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.4-mini",
  "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.4-mini",
  "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.4-mini","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.4-mini",
    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.4-mini",
  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.4-mini",
    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 — فیلدهای الزامی: model و input. متن با input_text، تصویر با input_image، فایل با input_file + AiFO file_id. Stateless؛ store: true و previous_response_id پشتیبانی نمی‌شوند.
  • تصویر (Responses): input_image (نه Chat image_url)
  • فایل (Responses): input_file با AiFO file_id از POST /v1/files (جدا از Chat Completions)
  • سقف پیوست Responses: حداکثر ۵ پیوست در مجموع (input_image + input_file) در کل input (شامل history)

فیلدهای الزامی 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.4-mini در AiFO چقدر است؟

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

gpt-5.4-mini برای چه کاربردی مناسب است؟

مدل gpt-5.4-mini از OpenAI (ChatGPT) برای تولید متن و پردازش چندرسانه‌ای طراحی شده است. این مدل قابلیت پردازش ورودی‌های متنی و تصویری را دارد و می‌تواند پاسخ‌های متنی و تصویری ارائه دهد. با استفاده از پارامترهای قابل تنظیم مانند temperature و max_tokens، کاربران می‌توانند خروجی مدل را به دلخواه خود تنظیم کنند.

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

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

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