> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Phaseo Gateway base URL: https://api.phaseo.app/v1. Send `Authorization: Bearer $PHASEO_API_KEY` with every request.
> Model IDs look like `provider/model`, for example `openai/gpt-6-astra`. Do not guess IDs: list them with `GET /v1/models` or check https://phaseo.app/models. `phaseo/free` routes to an available free model and needs no wallet balance.
> For new text integrations prefer `POST /v1/responses`. `POST /v1/chat/completions` (OpenAI format) and `POST /v1/messages` (Anthropic format) suit existing code.
> The full API contract is https://phaseo.app/docs/openapi/v1/openapi.yaml. Official SDKs: `@phaseo/sdk` (TypeScript) and `phaseo` (Python), plus Go, C#, PHP, Ruby and Rust.
> Search these docs over MCP at https://phaseo.app/docs/mcp, and install Phaseo skills with `npx skills add https://phaseo.app/docs`. If a page is wrong or out of date, report it with the MCP `submit_feedback` tool.
> Manage Phaseo accounts with the `phaseo` CLI (`npm install -g @phaseo/cli`, then `phaseo login` or `phaseo login --device-code`), the `/v1` Management API or the MCP server at `https://mcp.phaseo.app/mcp?access=manage`. Do not send users to the dashboard for account tasks. A person is still needed for sign-up, approving a sign-in, paying the first top-up on the checkout link that `phaseo credits add` returns when no card is saved, confirming each saved-card top-up from the emailed link, and account security (password, MFA, passkeys). Create API keys with `phaseo keys create --name <name> --json`; never guess one. Credit top-ups need `phaseo login --scopes billing:write` first. Task map: https://phaseo.app/docs/v1/developers/manage-from-an-agent.md.

# fx

> اربط وكيل البرمجة fx من Vercel Labs بـ Phaseo Gateway عبر اتصال نموذج مخصّص.

شغّل `phaseo fx` لإضافة Phaseo كاتصال مخصّص في [fx](https://fx.sh)، وكيل البرمجة مفتوح المصدر من Vercel Labs، أو أضف الاتصال إلى `~/.fx/settings.json` بنفسك. يستدعي fx نقطة النهاية Chat Completions في Phaseo ويعمل على macOS وLinux.

## الإعداد باستخدام Phaseo CLI

```bash theme={null}
phaseo login
phaseo fx --model openai/gpt-5.6-terra
```

إذا لم يكن fx مثبتًا، تعرض CLI أمر المثبّت الرسمي وتطلب موافقتك قبل تشغيله. ثم يقوم الإعداد بما يلي:

* يضيف اتصال `phaseo` إلى `~/.fx/settings.json`، مع الإبقاء على إعداداتك واتصالاتك الأخرى؛
* يزامن حتى 256 نموذجًا متوافقًا من Phaseo، وهو الحد الأقصى الذي يقبله fx، مع حدود السياق والإخراج الخاصة بها؛
* يجعل `phaseo` المزوّد النشط في fx ويسجّل المزوّد السابق حتى تتمكن الإزالة من استعادته؛
* ينشئ مفتاحًا باسم `Phaseo CLI: fx API Key` تنتهي صلاحيته بعد 90 يومًا وله حد إنفاق شهري قدره \$100، ويحفظه في الملف `~/.config/phaseo/integrations/fx.env` الذي لا يقرؤه إلا مالكه. شغّل `phaseo fx` مرة أخرى لاستبدال مفتاح منتهي الصلاحية.

استخدم `--catalog default` لإضافة النموذج المحدد فقط، أو `--dry-run` لمعاينة التغييرات.

يقرأ fx مفاتيح الاتصالات المخصّصة من متغيرات البيئة فقط، ولا يقرؤها أبدًا من ملف إعداداته. أضف هذا السطر إلى `~/.zshrc` أو `~/.bashrc` مرة واحدة، ثم افتح طرفية جديدة:

```bash theme={null}
[ -f "$HOME/.config/phaseo/integrations/fx.env" ] && . "$HOME/.config/phaseo/integrations/fx.env"
```

يضبط السطر `PHASEO_FX_API_KEY` عندما يكون الملف موجودًا، ولا يفعل شيئًا بعد إزالة التكامل. ثم ابدأ fx:

```bash theme={null}
fx
```

بدّل النماذج باستخدام `/model`، أو استخدم أي معرّف نموذج من Phaseo لتشغيل واحد باستخدام `FX_MODEL=<id> fx`. عُد إلى مزوّد آخر باستخدام `fx provider <name>`.

## إعداد fx يدويًا

أضف الاتصال إلى `~/.fx/settings.json`. لا يقبل fx الاتصالات المخصّصة في ملف `.fx.json` الخاص بالمشروع.

```json ~/.fx/settings.json theme={null}
{
  "provider": "phaseo",
  "providers": {
    "phaseo": {
      "protocol": "openai-chat-completions",
      "base_url": "https://api.phaseo.app/v1",
      "auth": { "type": "bearer", "env": "PHASEO_API_KEY" },
      "model_metadata": {
        "openai/gpt-5.6-terra": { "context_window": 400000, "max_output_tokens": 128000 }
      }
    }
  },
  "models": { "phaseo": "openai/gpt-5.6-terra" }
}
```

صدّر `PHASEO_API_KEY` وشغّل `fx`. صرّح بالحدود لكل نموذج تستخدمه: بدون `context_window`، لا يستطيع fx معرفة متى يضغط المحادثة. الحدود أعلاه أمثلة؛ خذ القيم الحقيقية من [نقطة نهاية النماذج](https://phaseo.app/docs/ar/v1/api-reference/endpoint/models.md).

## التحقق من أنه يعمل

1. شغّل `fx status --json` للتأكد من المزوّد النشط ونقطة النهاية والنموذج.
2. شغّل موجّهًا قصيرًا، مثل `fx ask "Summarize README.md"`، قبل العمل على تعديل الملفات.
3. تأكد من ظهور الطلب في **الإعدادات → الاستخدام → السجلات**.

إذا أبلغ fx عن بيانات اعتماد مفقودة، فافتح طرفية جديدة أو تأكد من وجود السطر في ملف تعريف الصدفة.

## إزالة Phaseo

```bash theme={null}
phaseo integrations remove fx
```

يزيل هذا الأمر اتصال `phaseo` ونموذجه، ويستعيد مزوّد fx السابق إذا كان Phaseo لا يزال نشطًا، ويحذف ملف المفتاح، ويلغي المفتاح.

## القيود المعروفة

ميزات fx التي لا تعمل إلا مع مزوّده المستضاف المدمج، مثل البحث على الويب وفحوصات الرصيد، غير متاحة عبر الاتصالات المخصّصة.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.