Migrate a text chat integration to Rynler

Move a supported text chat request in a small, reversible step. Check your application's required features before switching traffic.

Check compatibility first

The supported endpoint is POST /v1/chat/completions, with text messages using system, user and assistant roles. The request accepts model, messages, temperature, max_tokens and stream. Remove provider-specific parameters: unknown fields are rejected.

Tool calls, the Responses API and native token-by-token streaming are not supported by this integration. SSE output is buffered until upstream completion. Do not migrate workflows that depend on these features without changing and testing the workflow. Image availability must be checked separately through /v1/vision-capabilities.

Choose the destination model

Use a model ID returned by GET /v1/models with your Rynler key. A model name from another provider does not establish availability, identical output quality or matching context limits. Check the catalogue, prices and service availability.

Change the client configuration

Keep the old provider configuration for rollback. Use a separate Rynler key stored on your server, set the base URL to https://api.rynler.com/v1, and disable automatic retries while validating billing and error handling.

import OpenAI from 'openai';
import { randomUUID } from 'node:crypto';

// Install the tested client: npm install openai@7.23.0
const client = new OpenAI({
  apiKey: process.env.RYNLER_API_KEY,
  baseURL: 'https://api.rynler.com/v1',
  maxRetries: 0,
  timeout: 120000,
});
const response = await client.chat.completions.create({
  model: process.env.RYNLER_MODEL,
  messages: [{ role: 'user', content: 'Reply with a short greeting.' }],
  max_tokens: 128,
  stream: false,
}, { headers: { 'Idempotency-Key': randomUUID() } });
console.log(response.choices[0].message.content);

This SDK request shape is checked with a local mock transport. That verifies client serialization, not a live model response, latency or production billing. Running it against Rynler consumes credits when a request succeeds.

Validate before moving traffic

  1. Use a small representative set of your own prompts and define an acceptance criterion for output quality.
  2. Check the response, finish reason and reported usage. Review the workspace debit and any held reservation.
  3. Exercise invalid model, token limit and rate limit handling. Treat a timeout or gateway error as an uncertain outcome, not as a free failed request.
  4. Send a small approved portion of traffic, then compare quality and actual billed cost before expanding.

Assign a unique idempotency key to each new request and retain it for diagnosis. If an outcome is uncertain, inspect it in the workspace before creating new work. See request limits and retries.

Roll back without duplicating requests

Restore the previous client configuration for new requests. Keep uncertain Rynler requests and their reservations under review; do not automatically replay them at another provider. No latency, savings or quality equivalence is implied by changing the base URL.