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

# Move an existing app to impossibl

> Update your credentials, base URL, and model IDs, then verify text, tools, streams, and billing before switching traffic.

Start with one model call in a development environment. You need an [impossibl API key](/docs/quickstart#1-create-an-api-key) and a model from the [live catalog](/docs/models).

## Update three settings

| Setting                    | Use with impossibl                                          |
| -------------------------- | ----------------------------------------------------------- |
| API key                    | Your impossibl workspace key, stored as `IMPOSSIBL_API_KEY` |
| OpenAI-compatible base URL | `https://api.impossibl.com/v1`                              |
| Model                      | A full catalog ID, such as `openai/gpt-4o-mini`             |

A provider key or a key from another gateway does not authenticate to impossibl. To keep paying your own provider account, authenticate with an impossibl key and add the provider credential separately through [BYOK](/docs/byok).

## From OpenAI or another OpenAI-compatible gateway

<Accordion title="Show migration steps">
  Keep your Chat Completions call and update the client:

  ```python theme={null}
  import os
  from openai import OpenAI

  client = OpenAI(
      base_url="https://api.impossibl.com/v1",
      api_key=os.environ["IMPOSSIBL_API_KEY"],
  )

  response = client.chat.completions.create(
      model="openai/gpt-4o-mini",
      messages=[{"role": "user", "content": "Summarize the benefits of daily notes."}],
      max_tokens=256,
  )
  print(response.choices[0].message.content)
  ```

  If you use Responses, keep full conversation history in `input`. Replace stored-response lookup or `previous_response_id` chaining with application-managed history.
</Accordion>

## From the Vercel AI SDK

<Accordion title="Show migration steps">
  Configure an explicit provider that calls impossibl. A bare string model passed to the AI SDK uses its default gateway configuration, so changing only the model ID does not move your traffic.

  ```typescript theme={null}
  import { createOpenAI } from "@ai-sdk/openai";
  import { generateText } from "ai";

  const impossibl = createOpenAI({
    baseURL: "https://api.impossibl.com/v1",
    apiKey: process.env.IMPOSSIBL_API_KEY,
  });

  const { text } = await generateText({
    model: impossibl.chat("openai/gpt-4o-mini"),
    prompt: "Summarize the benefits of daily notes.",
  });
  console.log(text);
  ```

  Install `ai` and `@ai-sdk/openai` if your project does not already use them. The explicit `.chat()` selects Chat Completions. See [integrations](/docs/integrations#vercel-ai-sdk) for Responses configuration.
</Accordion>

## From OpenRouter

<Accordion title="Show migration steps">
  Use the same OpenAI-compatible client configuration above. Copy model IDs from impossibl's catalog even when the creator prefixes look familiar: model slugs, aliases, and availability can differ.

  Remove OpenRouter-specific routing fields and model suffixes from your request. Provider ordering, fallback model lists, plugins, and attribution headers do not configure impossibl routing. The gateway manages failover between serving routes for the model you request; see [routing](/docs/routing).
</Accordion>

## From Anthropic

<Accordion title="Show migration steps">
  Set the Anthropic SDK base URL to `https://api.impossibl.com` without `/v1`, supply your impossibl key, and keep `max_tokens` in your Messages request. Full examples are in [the Anthropic SDK guide](/docs/integrations#anthropic-sdk).
</Accordion>

## From an older impossibl integration

<Accordion title="Show migration steps">
  Continue to use `https://api.impossibl.com/v1`. The current docs do not introduce a `/v2` API prefix. Your workspace key chooses the workspace for a request; switching workspaces in the console does not change what an existing key belongs to.

  Review the live model catalog for retirements and replacements. Check [billing](/docs/billing), [BYOK balance rules](/docs/byok#billing), and [API compatibility](/docs/api-compatibility) instead of assuming older behavior still applies.
</Accordion>

## Verify before switching traffic

1. Run a short text request and check its model, provider, and cost in [logs](/docs/request-logs).
2. Exercise the features you use: streaming completion, tool-result turns, multimodal input, and reasoning. Keep complete assistant tool-call objects when returning results.
3. Check error handling for invalid credentials, insufficient balance, and provider failures. Do not retry configuration errors indefinitely.
4. Compare output quality, latency, token usage, and cost with representative application inputs.
5. Deploy with a server-side key and bounded retries. Keep your prior client configuration available while you observe the first production requests.

See [API keys](/docs/authentication), [billing](/docs/billing), and [errors](/docs/errors) for operational details.
