شروع سریع

مرشد API با SDK های استاندارد OpenAI کار می‌کند. کافی است آدرس پایه را عوض کنید و کلید مرشد خود را بگذارید. بدون تحریم، بدون کارت ارزی، پرداخت ریالی.

پایتون
from openai import OpenAI

client = OpenAI(
    base_url="https://api.morshed.ai/v1",
    api_key="mk-...",  # از بخش کلیدها بسازید
)

resp = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "سلام!"}],
)
print(resp.choices[0].message.content)
جاوااسکریپت
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.morshed.ai/v1",
  apiKey: "mk-...",
});

const resp = await client.chat.completions.create({
  model: "gpt-4o-mini",
  messages: [{ role: "user", content: "سلام!" }],
});
console.log(resp.choices[0].message.content);
curl
curl https://api.morshed.ai/v1/chat/completions \
  -H "Authorization: Bearer mk-..." \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "سلام!"}]}'

سایر سرویس‌ها

همه‌ی سرویس‌ها با همان کلاینت استاندارد OpenAI کار می‌کنند؛ فقط متد را عوض کنید.

امبدینگ/v1/embeddings
resp = client.embeddings.create(
    model="text-embedding-3-small",
    input="متن نمونه برای بردارسازی",
)
print(resp.data[0].embedding[:5])
تولید تصویر/v1/images/generations
resp = client.images.generate(
    model="gpt-image-1",
    prompt="یک گربه‌ی فضانورد، سبک نقاشی آبرنگ",
    size="1024x1024",
)
print(resp.data[0].url)
تبدیل متن به گفتار/v1/audio/speech
resp = client.audio.speech.create(
    model="tts-1",
    voice="alloy",
    input="سلام! این صدای تولیدشده است.",
)
resp.write_to_file("speech.mp3")
تبدیل گفتار به متن/v1/audio/transcriptions
resp = client.audio.transcriptions.create(
    model="whisper-1",
    file=open("audio.mp3", "rb"),
)
print(resp.text)

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

قیمت مدل‌ها (تومان بر ۱ میلیون توکن)

claude-haiku-3.5
Anthropic · پنجره متن ۲۰۰٬۰۰۰
۷۲٬۰۰۰ / ۳۶۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
claude-opus-4
Anthropic · پنجره متن ۲۰۰٬۰۰۰
۱٬۳۵۰٬۰۰۰ / ۶٬۷۵۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
claude-sonnet-4
Anthropic · پنجره متن ۲۰۰٬۰۰۰
۲۷۰٬۰۰۰ / ۱٬۳۵۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
claude-sonnet-4-6
Anthropic · پنجره متن ۲۰۰٬۰۰۰
۲۷۰٬۰۰۰ / ۱٬۳۵۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
c
codestral
Mistral · پنجره متن ۲۵۶٬۰۰۰
۲۷٬۰۰۰ / ۸۱٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
c
command-a
Cohere · پنجره متن ۲۵۶٬۰۰۰
۲۲۵٬۰۰۰ / ۹۰۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
c
command-r-plus
Cohere · پنجره متن ۱۲۸٬۰۰۰
۲۲۵٬۰۰۰ / ۹۰۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
d
deepseek-r1
DeepSeek · پنجره متن ۱۶۴٬۰۰۰
۴۹٬۵۰۰ / ۱۹۷٬۱۰۰
تومان (ورودی/خروجی) بر ۱M
d
deepseek-v3
DeepSeek · پنجره متن ۱۶۴٬۰۰۰
۲۴٬۳۰۰ / ۹۹٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
gemini-2.0-flash
Google · پنجره متن ۱٬۰۰۰٬۰۰۰
۹٬۰۰۰ / ۳۶٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
gemini-2.5-flash
Google · پنجره متن ۱٬۰۰۰٬۰۰۰
۲۷٬۰۰۰ / ۲۲۵٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
gemini-2.5-pro
Google · پنجره متن ۱٬۰۰۰٬۰۰۰
۱۱۲٬۵۰۰ / ۹۰۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
g
glm-4.5
Z.AI · پنجره متن ۱۲۸٬۰۰۰
۵۴٬۰۰۰ / ۱۹۸٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
gpt-4.1
OpenAI · پنجره متن ۱٬۰۰۰٬۰۰۰
۱۸۰٬۰۰۰ / ۷۲۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
gpt-4.1-mini
OpenAI · پنجره متن ۱٬۰۰۰٬۰۰۰
۳۶٬۰۰۰ / ۱۴۴٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
gpt-4.1-nano
OpenAI · پنجره متن ۱٬۰۰۰٬۰۰۰
۹٬۰۰۰ / ۳۶٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
gpt-4o
OpenAI · پنجره متن ۱۲۸٬۰۰۰
۲۲۵٬۰۰۰ / ۹۰۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
gpt-4o-mini
OpenAI · پنجره متن ۱۲۸٬۰۰۰
۱۳٬۵۰۰ / ۵۴٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
g
grok-3
xAI · پنجره متن ۱۳۱٬۰۰۰
۲۷۰٬۰۰۰ / ۱٬۳۵۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
g
grok-3-mini
xAI · پنجره متن ۱۳۱٬۰۰۰
۲۷٬۰۰۰ / ۴۵٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
k
kimi-k2
Moonshot · پنجره متن ۱۳۱٬۰۰۰
۴۹٬۵۰۰ / ۱۹۸٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
l
llama-3.1-nemotron-70b
NVIDIA · پنجره متن ۱۳۱٬۰۰۰
۱۰٬۸۰۰ / ۲۷٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
l
llama-3.3-70b
Meta · پنجره متن ۱۲۸٬۰۰۰
۹٬۰۰۰ / ۲۲٬۵۰۰
تومان (ورودی/خروجی) بر ۱M
l
llama-4-maverick
Meta · پنجره متن ۱٬۰۰۰٬۰۰۰
۱۸٬۰۰۰ / ۷۶٬۵۰۰
تومان (ورودی/خروجی) بر ۱M
l
llama-4-scout
Meta · پنجره متن ۱۰٬۰۰۰٬۰۰۰
۷٬۲۰۰ / ۲۷٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
m
minimax-m1
MiniMax · پنجره متن ۱٬۰۰۰٬۰۰۰
۲۷٬۰۰۰ / ۱۴۸٬۵۰۰
تومان (ورودی/خروجی) بر ۱M
m
mistral-large
Mistral · پنجره متن ۱۲۸٬۰۰۰
۱۸۰٬۰۰۰ / ۵۴۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
m
mistral-small
Mistral · پنجره متن ۱۲۸٬۰۰۰
۹٬۰۰۰ / ۲۷٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
n
nova-lite
Amazon · پنجره متن ۳۰۰٬۰۰۰
۵٬۴۰۰ / ۲۱٬۶۰۰
تومان (ورودی/خروجی) بر ۱M
n
nova-pro
Amazon · پنجره متن ۳۰۰٬۰۰۰
۷۲٬۰۰۰ / ۲۸۸٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
o3
OpenAI · پنجره متن ۲۰۰٬۰۰۰
۱۸۰٬۰۰۰ / ۷۲۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
o4-mini
OpenAI · پنجره متن ۲۰۰٬۰۰۰
۹۹٬۰۰۰ / ۳۹۶٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
p
phi-4
Microsoft · پنجره متن ۱۶٬۰۰۰
۶٬۳۰۰ / ۱۲٬۶۰۰
تومان (ورودی/خروجی) بر ۱M
q
qwen-2.5-72b
Qwen · پنجره متن ۱۳۱٬۰۰۰
۳۱٬۵۰۰ / ۳۶٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
q
qwen-3-235b
Qwen · پنجره متن ۱۳۱٬۰۰۰
۱۸٬۰۰۰ / ۵۴٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
s
sonar
Perplexity · پنجره متن ۱۲۷٬۰۰۰
۹۰٬۰۰۰ / ۹۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M
s
sonar-pro
Perplexity · پنجره متن ۲۰۰٬۰۰۰
۲۷۰٬۰۰۰ / ۱٬۳۵۰٬۰۰۰
تومان (ورودی/خروجی) بر ۱M

قیمت‌ها با نرخ ارز روز به‌روز می‌شوند.