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

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

# Required: model, messages (text + optional file_id — upload via /v1/files first)
# 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)
# file.file_id in messages: optional — upload via POST /v1/files first (AiFO file_…)
curl https://api.aifoapp.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":"لطفاً خلاصه‌ای از این سند PDF را که با استفاده از AiFO file_id ارسال شده، ارائه دهید."},{"type":"file","file":{"file_id":"file_..."}}]}],"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": "anthropic/claude-opus-4.8-fast",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "لطفاً خلاصه‌ای از این سند PDF را که با استفاده از AiFO file_id ارسال شده، ارائه دهید."
        },
        {
          "type": "file",
          "file": {
            "file_id": "file_..."
          }
        }
      ]
    }
  ],
  "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)
# file.file_id in messages: optional — upload via POST /v1/files first (AiFO file_…)

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": "anthropic/claude-opus-4.8-fast",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "لطفاً خلاصه‌ای از این سند PDF را که با استفاده از AiFO file_id ارسال شده، ارائه دهید."
        },
        {
          "type": "file",
          "file": {
            "file_id": "file_..."
          }
        }
      ]
    }
  ],
  "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)
# file.file_id in messages: optional — upload via POST /v1/files first (AiFO file_…)

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": "anthropic/claude-opus-4.8-fast",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "لطفاً خلاصه‌ای از این سند PDF را که با استفاده از AiFO file_id ارسال شده، ارائه دهید."
        },
        {
          "type": "file",
          "file": {
            "file_id": "file_..."
          }
        }
      ]
    }
  ],
  "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)
# file.file_id in messages: optional — upload via POST /v1/files first (AiFO file_…)

console.log(data);

پارامترها

ورودی‌ها

  • متن: از طریق messages یا input (بسته به endpoint)
  • تصویر (Chat): image_url داخل messages
  • فایل (Chat): ابتدا POST /v1/files سپس { "type": "file", "file": { "file_id": "file_..." } } در messages (شناسهٔ AiFO؛ نه OpenAI Files). به‌عنوان جایگزین، file_data (data URL) در صورت پشتیبانی transport.

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

پارامترها

نام نوع الزامی/اختیاری پیش‌فرض توضیح
temperature number اختیاری 1
max_tokens number اختیاری 1024
top_p number اختیاری 1
frequency_penalty number اختیاری 0
presence_penalty number اختیاری 0

FAQ

قیمت Anthropic: Claude Opus 4.8 (Fast) در AiFO چقدر است؟

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

Anthropic: Claude Opus 4.8 (Fast) برای چه کاربردی مناسب است؟

مدل Anthropic: Claude Opus 4.8 (Fast) با قابلیت پردازش چندرسانه‌ای، امکان تعامل متنی و تصویری را فراهم می‌کند. این مدل با استفاده از endpoint /v1/chat/completions و روش POST، پاسخ‌های سریع و دقیق ارائه می‌دهد و از پارامترهای تنظیمی مانند temperature و max_tokens پشتیبانی می‌کند.

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

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

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