AiFO 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 جریمه حضور توکن‌ها در خروجی

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

  • هزینه استفاده بر اساس تعداد توکن‌ها محاسبه می‌شود
  • ورودی صوتی پشتیبانی نمی‌شود
  • نیاز به اتصال اینترنت برای استفاده از API

FAQ

هزینه استفاده از این مدل چقدر است؟

هزینه استفاده از این مدل بر اساس تعداد توکن‌های ورودی و خروجی محاسبه می‌شود. قیمت هر ۱ میلیون توکن ورودی ۱.۷۵ دلار و خروجی ۱۴ دلار است.

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

برای دسترسی به API، باید از طریق AiFO ثبت‌نام کرده و کلید API دریافت کنید.

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