AiFO AiFO مستندات AiFO
قیمت
Input: 0.25 USD · Output: 2 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-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.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-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
# 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-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
# 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-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
# 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 حداکثر تعداد توکن‌های تولیدی، به max_completion_tokens نگاشت می‌شود.
top_p number اختیاری 1 نمونه‌گیری از توزیع توکن‌ها بر اساس احتمال تجمعی
frequency_penalty number اختیاری 0 کاهش احتمال تکرار توکن‌های مشابه در پاسخ
presence_penalty number اختیاری 0 کاهش احتمال حضور توکن‌های مشابه در پاسخ

محدودیت‌ها و نکات

  • مدل gpt-5-mini به دلیل محدودیت‌های پردازشی ممکن است در برخی موارد کند عمل کند.
  • هزینه استفاده از مدل بر اساس تعداد توکن‌های پردازش شده محاسبه می‌شود.
  • ورودی‌های صوتی توسط این مدل پشتیبانی نمی‌شود.

FAQ

هزینه استفاده از gpt-5-mini چگونه محاسبه می‌شود؟

هزینه بر اساس تعداد توکن‌های ورودی و خروجی محاسبه می‌شود، به ازای هر ۱ میلیون توکن ورودی ۰.۲۵ دلار و خروجی ۲ دلار است.

آیا می‌توان از این API برای پردازش صوتی استفاده کرد؟

خیر، این مدل از ورودی‌های صوتی پشتیبانی نمی‌کند.

چگونه می‌توان به API از طریق AiFO دسترسی پیدا کرد؟

برای دسترسی به API از طریق AiFO، باید ابتدا یک حساب کاربری ایجاد کنید و سپس از کلید API ارائه شده استفاده کنید.

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