May 7th, 2026

Use your agents with any OpenAI SDK — 7 May 2026 Update


Full compatibility, zero friction

Swiftask agents are now fully compatible with the OpenAI SDK. You can use any OpenAI client library (Python, JavaScript, Node.js, or others) to send messages to your agents and receive responses, just as you would with OpenAI's own models. No special integration code needed, just point the SDK to Swiftask's API endpoint, authenticate, and go.


OpenAI SDK Compatibility for Agents

Your Swiftask agents now work seamlessly with the OpenAI SDK. This means you can leverage the familiar OpenAI interface, the one your team already knows, while powering it with your custom agents, knowledge bases, and skills.

Whether you're integrating agents into existing applications, automating document processing, or building real-time chat experiences, the OpenAI SDK compatibility makes it trivial to do.

  • Base URL: https://api.swiftask.fr/v1

  • Authentication: Use your existing Swiftask API key (generate one in Account Settings → API)

  • Model parameter: Specify your agent's slug (found in Agent Settings → API tab)

  • Supported SDKs: Python, JavaScript, TypeScript, Node.js, and any other OpenAI-compatible client

  • Streaming: Full support for real-time responses via Server-Sent Events (SSE)

How to test it:

  1. Create an API key : Go to Account Settings → API → Create new key. Copy it immediately (shown only once). Optionally set an expiration date for security.

  2. Get your agent's slug : Open your agent → Settings (gear icon) → API tab → Copy the Agent slug.

  3. Install the OpenAI SDK : Run pip install openai (Python) or npm install openai (JavaScript).

  4. Configure and call your agent : Here's a quick Python example:

from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.swiftask.fr/v1" ) response = client.chat.completions.create( model="AGENT_SLUG", messages=[{"role": "user", "content": "Hello, how can you help me?"}] ) print(response.choices[0].message.content) 

And the same in JavaScript:

import OpenAI from 'openai'; const client = new OpenAI({ apiKey: 'YOUR_API_KEY', baseURL: 'https://api.swiftask.fr/v1', }); const response = await client.chat.completions.create({ model: 'AGENT_SLUG', messages: [{ role: 'user', content: 'Hello, how can you help me?' }] }); console.log(response.choices[0].message.content); 
  1. Enable streaming (optional) : For real-time responses, set stream=True (Python) or stream: true (JavaScript). The response will stream back character by character, giving users immediate feedback.


Practical Use Cases

Integrate agents into support chatbots : You have a customer support agent in Swiftask and want to use it in your existing Node.js application. Now you can use the OpenAI SDK directly, no custom code needed.

Batch process documents : Process hundreds of documents with your document analysis agent using a simple Python loop. The agent processes each one and returns structured results.

Stream responses in web apps : Display agent responses in real-time on your web page. Streaming makes the experience feel faster and more interactive.


Best Practices

  • Secure your API key : Treat it like a password. Store it in environment variables or secret management tools, never hardcode it.

  • Set expiration dates : When creating an API key, set an expiration date for security. Rotate keys periodically.

  • Use descriptive key names : Name your keys by use case (e.g., "Production Bot", "Testing Bot") to track usage and manage access.

  • Handle errors gracefully : Wrap API calls in try-catch blocks and provide meaningful error messages to users.

  • Use streaming for better UX : Streaming responses feel faster to end users because they see content appear in real-time instead of waiting for the full response.


Get Started Now

Ready to use your agents with the OpenAI SDK?

Head to Account Settings → API, create your key, grab your agent's slug, and start building.

Your agents are now as easy to integrate as OpenAI's GPT models. 🎯

More informations : https://docs.swiftask.ai/