AiFO مستندات AiFO
قیمت
Input: 10 USD · Output: 50 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":"anthropic/claude-opus-4.8-fast","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": "anthropic/claude-opus-4.8-fast",
  "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": "anthropic/claude-opus-4.8-fast",
  "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": "anthropic/claude-opus-4.8-fast",
  "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);

پارامترها

ورودی‌ها

  • متن
  • تصویر

پارامترها

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

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

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

FAQ

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

هزینه پردازش ورودی ۱۰ دلار و خروجی ۵۰ دلار به ازای هر میلیون توکن است.

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

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

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