Build around
the work.
Start with model access, agent workflows or knowledge. Choose the integration path that fits your application.
In short:بوابة متوافقة مع OpenAI لبناء تطبيقات الذكاء الاصطناعي. استخدم حزم OpenAI SDK الرسمية أو طلبات HTTP العادية مع مفتاح Swfte API الخاص بك.
application → model access → response
Model access
Connect your application to model access. Start by reviewing routing, authentication and usage requirements.
Explore ConnectFollow the published reference.
Read the SDK examples and integration guidance alongside the product you intend to use.
Open the developer referenceBefore your first integration
Agree the credential boundary, test inputs, failure handling and the usage you need to observe.
Discuss an integrationملعب API تفاعلي
اختبار استدعاءات API في الوقت الفعلي مع أمثلة التعليمات البرمجية الحية والنتائج الفورية.
curl https://api.swfte.com/agents/v2/gateway/chat/completions \
-H "Authorization: Bearer $SWFTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai:gpt-4o-mini",
"messages": [
{ "role": "user", "content": "Say hello in five words." }
]
}'مسار التكامل الموجه الخاص بك
ابدأ في دقائق مع دليل التكامل خطوة بخطوة.
export SWFTE_API_KEY="sk-swfte-..."Create an API key
Open the Connect console, create an API key and keep it in an environment variable.
# pip install openai
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.swfte.com/agents/v2/gateway",
api_key=os.environ["SWFTE_API_KEY"],
)Point the OpenAI SDK at Swfte
The gateway is OpenAI-compatible. Install the official openai package and set the base URL.
response = client.chat.completions.create(
model="openai:gpt-4o-mini",
messages=[{"role": "user", "content": "Hello, world!"}],
)
print(response.choices[0].message.content)Make your first request
Use a mini model on the free plan. Any OpenAI-compatible client or plain curl works the same way.
مصمم للمطورين
كل ما تحتاجه لبناء تطبيقات الذكاء الاصطناعي على مستوى الإنتاج.
تعريفات TypeScript كاملة
مع الإكمال التلقائي والتحقق في وقت التجميع.
TypeScript و Python و Go و Ruby
والمزيد مع التكافؤ الكامل للميزات.
البث رمزًا تلو الآخر
مع دعم SSE و WebSocket.
الكمون والرموز والتكاليف والأخطاء
يتم تتبعها تلقائيًا.
الأسئلة المتداولة
لا توجد حزمة SDK خاصة بـ Swfte بعد. البوابة متوافقة مع OpenAI، لذا تعمل حزم OpenAI SDK الرسمية (Python وTypeScript وغيرها) عند ضبط عنوان URL الأساسي على بوابة Swfte، وكذلك أي عميل HTTP.
استخدم مفاتيح API المخزنة في متغيرات البيئة أو التي يتم تمريرها مباشرة إلى SDK. نحن ندعم OAuth2 لتكامل SSO للمؤسسات ونوفر تدوير آمن للمفاتيح.
المستوى المجاني: 100 طلب/دقيقة. Pro: 1,000 طلب/دقيقة. المؤسسات: حدود مخصصة مع سعة مخصصة ومعالجة الانفجار.
يوفر SDK فئات أخطاء مكتوبة مع رسائل مفصلة. تتضمن جميع الأخطاء معرفات الطلب للتصحيح والدعم. نحن نقدم أيضًا إعادة المحاولة التلقائية مع التراجع الأسي.
نعم! جميع SDKs تدعم Server-Sent Events (SSE) للبث في الوقت الفعلي. يمكنك استقبال الرموز عند إنشائها لواجهات المستخدم سريعة الاستجابة.
هل أنت مستعد لبدء البناء؟
احصل على مفتاح API الخاص بك وابدأ في البناء في دقائق.