---
title: "impossibl | the ai api"
description: "one api. every model. 0% usage markup."
canonical: https://impossibl.com/
human_url: https://impossibl.com/
markdown_url: https://impossibl.com/index.md
---

[models](<https://impossibl.com/models>) · [docs](<https://impossibl.com/docs>) · [changelog](<https://impossibl.com/changelog>) · [company](<https://impossibl.com/about>)

# the ai api

one endpoint. every model.

[get started](<https://impossibl.com/sign-in>) · [Explore Models](<https://impossibl.com/models>)

## one string for whatever's next

impossibl init

### new models are just strings

- anthropic/claude-fable-5-1 · new
- openai/gpt-6-astra · new
- google/gemini-3.8-flash
- xai/grok-4.6
- deepseek/deepseek-v4-pro
- zai/glm-5.3
- moonshotai/kimi-k3
- thinkingmachines/inkling

### integration is a one-liner

#### openai · responses, python

```diff
# responses API
import os
from openai import OpenAI

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

resp = client.responses.create(
    model="anthropic/claude-fable-5-1",
    input="a haiku about uptime",
)
print(resp.output_text)
```

#### openai · responses, javascript

```diff
// responses API
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.IMPOSSIBL_API_KEY,
- baseURL: "https://api.openai.com/v1",
+ baseURL: "https://api.impossibl.com/v1",
});

const resp = await client.responses.create({
  model: "anthropic/claude-fable-5-1",
  input: "a haiku about uptime",
});
console.log(resp.output_text);
```

#### openai · responses, typescript

```diff
// responses API
import OpenAI from "openai";

const client: OpenAI = new OpenAI({
  apiKey: process.env.IMPOSSIBL_API_KEY,
- baseURL: "https://api.openai.com/v1",
+ baseURL: "https://api.impossibl.com/v1",
});

const resp = await client.responses.create({
  model: "anthropic/claude-fable-5-1",
  input: "a haiku about uptime",
});
console.log(resp.output_text);
```

#### openai · responses, c\#

```diff
// responses API
using System;
using System.ClientModel;
using OpenAI.Responses;

string apiKey = Environment.GetEnvironmentVariable("IMPOSSIBL_API_KEY")
    ?? throw new InvalidOperationException("IMPOSSIBL_API_KEY is not set");

ResponsesClient client = new(
    credential: new ApiKeyCredential(apiKey),
    options: new ResponsesClientOptions
    {
-       Endpoint = new Uri("https://api.openai.com/v1"),
+       Endpoint = new Uri("https://api.impossibl.com/v1"),
    });

ResponseResult resp = await client.CreateResponseAsync(
    model: "anthropic/claude-fable-5-1",
    userInputText: "a haiku about uptime");
Console.WriteLine(resp.GetOutputText());
```

#### openai · responses, java

```diff
// responses API
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.responses.Response;
import com.openai.models.responses.ResponseCreateParams;

public class Main {
    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.builder()
                .apiKey(System.getenv("IMPOSSIBL_API_KEY"))
-               .baseUrl("https://api.openai.com/v1")
+               .baseUrl("https://api.impossibl.com/v1")
                .build();

        ResponseCreateParams params = ResponseCreateParams.builder()
                .model("anthropic/claude-fable-5-1")
                .input("a haiku about uptime")
                .build();
        Response resp = client.responses().create(params);
        resp.output().stream()
                .flatMap(item -> item.message().stream())
                .flatMap(message -> message.content().stream())
                .flatMap(content -> content.outputText().stream())
                .forEach(output -> System.out.println(output.text()));
    }
}
```

#### openai · responses, go

```diff
// responses API
package main

import (
	"context"
	"fmt"
	"os"

	"github.com/openai/openai-go/v3"
	"github.com/openai/openai-go/v3/option"
	"github.com/openai/openai-go/v3/responses"
)

func main() {
	client := openai.NewClient(
		option.WithAPIKey(os.Getenv("IMPOSSIBL_API_KEY")),
-		option.WithBaseURL("https://api.openai.com/v1"),
+		option.WithBaseURL("https://api.impossibl.com/v1"),
	)

	resp, err := client.Responses.New(context.Background(), responses.ResponseNewParams{
		Model: "anthropic/claude-fable-5-1",
		Input: responses.ResponseNewParamsInputUnion{
			OfString: openai.String("a haiku about uptime"),
		},
	})
	if err != nil {
		panic(err)
	}

	fmt.Println(resp.OutputText())
}
```

#### openai · responses, ruby

```diff
# responses API
require "openai"

client = OpenAI::Client.new(
  api_key: ENV.fetch("IMPOSSIBL_API_KEY"),
- base_url: "https://api.openai.com/v1",
+ base_url: "https://api.impossibl.com/v1",
)

resp = client.responses.create(
  model: "anthropic/claude-fable-5-1",
  input: "a haiku about uptime"
)
puts(resp.output_text)
```

#### openai · completions, python

```diff
# chat completions
import os
from openai import OpenAI

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

resp = client.chat.completions.create(
    model="anthropic/claude-fable-5-1",
    messages=[{
        "role": "user",
        "content": "a haiku about uptime",
    }],
)
print(resp.choices[0].message.content)
```

#### openai · completions, javascript

```diff
// chat completions
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.IMPOSSIBL_API_KEY,
- baseURL: "https://api.openai.com/v1",
+ baseURL: "https://api.impossibl.com/v1",
});

const resp = await client.chat.completions.create({
  model: "anthropic/claude-fable-5-1",
  messages: [{
    role: "user",
    content: "a haiku about uptime",
  }],
});
console.log(resp.choices[0].message.content);
```

#### openai · completions, typescript

```diff
// chat completions
import OpenAI from "openai";

const client: OpenAI = new OpenAI({
  apiKey: process.env.IMPOSSIBL_API_KEY,
- baseURL: "https://api.openai.com/v1",
+ baseURL: "https://api.impossibl.com/v1",
});

const resp = await client.chat.completions.create({
  model: "anthropic/claude-fable-5-1",
  messages: [{
    role: "user",
    content: "a haiku about uptime",
  }],
});
console.log(resp.choices[0].message.content);
```

#### openai · completions, c\#

```diff
// chat completions
using System;
using System.ClientModel;
using OpenAI;
using OpenAI.Chat;

string apiKey = Environment.GetEnvironmentVariable("IMPOSSIBL_API_KEY")
    ?? throw new InvalidOperationException("IMPOSSIBL_API_KEY is not set");

ChatClient client = new(
    model: "anthropic/claude-fable-5-1",
    credential: new ApiKeyCredential(apiKey),
    options: new OpenAIClientOptions
    {
-       Endpoint = new Uri("https://api.openai.com/v1"),
+       Endpoint = new Uri("https://api.impossibl.com/v1"),
    });

ChatCompletion resp = await client.CompleteChatAsync("a haiku about uptime");
Console.WriteLine(resp.Content[0].Text);
```

#### openai · completions, java

```diff
// chat completions
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.chat.completions.ChatCompletion;
import com.openai.models.chat.completions.ChatCompletionCreateParams;

public class Main {
    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.builder()
                .apiKey(System.getenv("IMPOSSIBL_API_KEY"))
-               .baseUrl("https://api.openai.com/v1")
+               .baseUrl("https://api.impossibl.com/v1")
                .build();

        ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
                .model("anthropic/claude-fable-5-1")
                .addUserMessage("a haiku about uptime")
                .build();
        ChatCompletion resp = client.chat().completions().create(params);
        System.out.println(resp.choices().get(0).message().content().orElse(""));
    }
}
```

#### openai · completions, go

```diff
// chat completions
package main

import (
	"context"
	"fmt"
	"os"

	"github.com/openai/openai-go/v3"
	"github.com/openai/openai-go/v3/option"
)

func main() {
	client := openai.NewClient(
		option.WithAPIKey(os.Getenv("IMPOSSIBL_API_KEY")),
-		option.WithBaseURL("https://api.openai.com/v1"),
+		option.WithBaseURL("https://api.impossibl.com/v1"),
	)

	resp, err := client.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
		Model: "anthropic/claude-fable-5-1",
		Messages: []openai.ChatCompletionMessageParamUnion{
			openai.UserMessage("a haiku about uptime"),
		},
	})
	if err != nil {
		panic(err)
	}

	fmt.Println(resp.Choices[0].Message.Content)
}
```

#### openai · completions, ruby

```diff
# chat completions
require "openai"

client = OpenAI::Client.new(
  api_key: ENV.fetch("IMPOSSIBL_API_KEY"),
- base_url: "https://api.openai.com/v1",
+ base_url: "https://api.impossibl.com/v1",
)

resp = client.chat.completions.create(
  model: "anthropic/claude-fable-5-1",
  messages: [{
    role: "user",
    content: "a haiku about uptime",
  }]
)
puts(resp.choices[0].message.content)
```

#### anthropic · python

```diff
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ["IMPOSSIBL_API_KEY"],
-   base_url="https://api.anthropic.com",
+   base_url="https://api.impossibl.com",
)

message = client.messages.create(
    model="anthropic/claude-fable-5-1",
    max_tokens=64,
    messages=[{"role": "user",
        "content": "a haiku about uptime"}],
)

for block in message.content:
    if block.type == "text":
        print(block.text)
```

#### anthropic · javascript

```diff
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.IMPOSSIBL_API_KEY,
- baseURL: "https://api.anthropic.com",
+ baseURL: "https://api.impossibl.com",
});

const message = await client.messages.create({
  model: "anthropic/claude-fable-5-1",
  max_tokens: 64,
  messages: [{ role: "user", content: "a haiku about uptime" }],
});

for (const block of message.content) {
  if (block.type === "text") console.log(block.text);
}
```

#### anthropic · typescript

```diff
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.IMPOSSIBL_API_KEY,
- baseURL: "https://api.anthropic.com",
+ baseURL: "https://api.impossibl.com",
});

const message: Anthropic.Message = await client.messages.create({
  model: "anthropic/claude-fable-5-1",
  max_tokens: 64,
  messages: [{ role: "user", content: "a haiku about uptime" }],
});

for (const block of message.content) {
  if (block.type === "text") console.log(block.text);
}
```

#### anthropic · c\#

```diff
using System;
using Anthropic;
using Anthropic.Models.Messages;

AnthropicClient client = new()
{
    ApiKey = Environment.GetEnvironmentVariable("IMPOSSIBL_API_KEY"),
-   BaseUrl = "https://api.anthropic.com",
+   BaseUrl = "https://api.impossibl.com",
};

MessageCreateParams parameters = new()
{
    Model = "anthropic/claude-fable-5-1",
    MaxTokens = 64,
    Messages =
    [
        new()
        {
            Role = Role.User,
            Content = "a haiku about uptime",
        },
    ],
};

var message = await client.Messages.Create(parameters);
foreach (var block in message.Content)
{
    if (block.TryPickText(out var textBlock))
    {
        Console.WriteLine(textBlock.Text);
    }
}
```

#### anthropic · go

```diff
package main

import (
    "context"
    "fmt"
    "os"

    "github.com/anthropics/anthropic-sdk-go"
    "github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
    client := anthropic.NewClient(
        option.WithAPIKey(os.Getenv("IMPOSSIBL_API_KEY")),
-       option.WithBaseURL("https://api.anthropic.com"),
+       option.WithBaseURL("https://api.impossibl.com"),
    )

    message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
        Model: "anthropic/claude-fable-5-1",
        MaxTokens: 64,
        Messages: []anthropic.MessageParam{
            anthropic.NewUserMessage(anthropic.NewTextBlock("a haiku about uptime")),
        },
    })
    if err != nil {
        panic(err)
    }

    for _, block := range message.Content {
        if textBlock, ok := block.AsAny().(anthropic.TextBlock); ok {
            fmt.Println(textBlock.Text)
        }
    }
}
```

#### anthropic · java

```diff
import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.messages.ContentBlock;
import com.anthropic.models.messages.Message;
import com.anthropic.models.messages.MessageCreateParams;

public class Main {
    public static void main(String[] args) {
        AnthropicClient client = AnthropicOkHttpClient.builder()
            .apiKey(System.getenv("IMPOSSIBL_API_KEY"))
-           .baseUrl("https://api.anthropic.com")
+           .baseUrl("https://api.impossibl.com")
            .build();

        MessageCreateParams params = MessageCreateParams.builder()
            .model("anthropic/claude-fable-5-1")
            .maxTokens(64)
            .addUserMessage("a haiku about uptime")
            .build();
        Message message = client.messages().create(params);

        for (ContentBlock block : message.content()) {
            if (block.isText()) {
                System.out.println(block.asText().text());
            }
        }
    }
}
```

#### anthropic · php

```diff
<?php

use Anthropic\Client;

require __DIR__ . "/vendor/autoload.php";

$client = new Client(
  apiKey: getenv("IMPOSSIBL_API_KEY") ?: "",
- baseUrl: "https://api.anthropic.com",
+ baseUrl: "https://api.impossibl.com",
);

$message = $client->messages->create(
  model: "anthropic/claude-fable-5-1",
  maxTokens: 64,
  messages: [["role" => "user", "content" => "a haiku about uptime"]],
);

echo $message->content[0]->text, PHP_EOL;
```

#### anthropic · ruby

```diff
require "anthropic"

client = Anthropic::Client.new(
  api_key: ENV.fetch("IMPOSSIBL_API_KEY"),
- base_url: "https://api.anthropic.com",
+ base_url: "https://api.impossibl.com",
)

message = client.messages.create(
  model: "anthropic/claude-fable-5-1",
  max_tokens: 64,
  messages: [{role: "user", content: "a haiku about uptime"}]
)

message.content.each do |block|
  puts block.text if block.type == :text
end
```

#### ai sdk · typescript

```diff
import { createOpenAI } from "@ai-sdk/openai";
import { generateText } from "ai";

const apiKey = process.env.IMPOSSIBL_API_KEY;
if (!apiKey) throw new Error("IMPOSSIBL_API_KEY is not set");

const gateway = createOpenAI({
  apiKey,
- baseURL: "https://api.openai.com/v1",
+ baseURL: "https://api.impossibl.com/v1",
});

const { text } = await generateText({
  model: gateway("anthropic/claude-fable-5-1"),
  prompt: "a haiku about uptime",
});
console.log(text);
```

#### agents · Claude Code

```diff
export ANTHROPIC_BASE_URL="https://api.impossibl.com"
unset ANTHROPIC_API_KEY
export ANTHROPIC_AUTH_TOKEN="imp-rt-..."
export ANTHROPIC_MODEL="anthropic/claude-fable-5-1"
claude
```

#### curl · curl

```diff
curl https://api.impossibl.com/v1/chat/completions \
  -H "authorization: bearer $IMPOSSIBL_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "anthropic/claude-fable-5-1",
    "messages": [{ "role": "user", "content": "a haiku about uptime" }]
  }'
```

```text
a haiku about uptime
```

#### anthropic/claude-fable-5-1

```text
the pager stays dark
requests slip around the wreck
dawn reads a clean log
```

#### openai/gpt-6-astra

```text
four nines and counting
the graph a flat horizon
nobody looks up
```

#### google/gemini-3.8-flash

```text
one region goes dim
traffic leans the other way
the answer arrives
```

#### xai/grok-4.6

```text
a server catches fire
your request already left town
on a faster road
```

#### deepseek/deepseek-v4-pro

```text
midnight deploy breaks
somewhere a fallback wakes up
morning knows nothing
```

#### zai/glm-5.3

```text
the status page rests
green as an untouched meadow
uptime, unbothered
```

#### moonshotai/kimi-k3

```text
moon over the rack
requests arc across the dark
nothing ever waits
```

#### thinkingmachines/inkling

```text
open weights stay lit
through the long unbroken night
ink dries after dawn
```

## unified agentic experience.

impossibl help

### unified usage

tokens per second, every provider

### dashboardless

tokens flow without you. dashboard is optional

account · keys · usage · billing

### automatic fallbacks

providers degrade. you're always up

### one bill

every provider, one balance

this month: $128.40

- anthropic: $48.79

- openai: $33.38

- google: $26.96

- other: $19.26

## 60s to first token.

impossibl setup

### agent

one prompt for your agent. no reasoning tokens for you.

#### 0 · prompt your agent

```text
read https://impossibl.com/auth.md and set me up.
```

#### 1 · let it cook

account, api keys and test curl automatically made for you. dashboardless.

#### 2 · claim your dashboard · optional

observability, control settings and $1 in credits. ask your agent to claim it.

### human

three steps by hand.

#### 0 · open the dashboard

sign in, then click api keys.

[open dashboard](<https://impossibl.com/dashboard>)

#### 1 · create an api key

imp-rt-••••••••••••

#### 2 · connect your app

use the new key, then flip the base url. same sdk, one line.

#### openai

```diff
import os
from openai import OpenAI

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

#### openai responses

```diff
import os
from openai import OpenAI

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

resp = client.responses.create(
    model="openai/gpt-5.5",
    input="hello",
)
```

#### anthropic

```diff
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ["IMPOSSIBL_API_KEY"],
-   base_url="https://api.anthropic.com",
+   base_url="https://api.impossibl.com",
)
```

#### google gen ai

```diff
import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({
  apiKey: process.env.IMPOSSIBL_API_KEY,
- httpOptions: { baseUrl: "https://generativelanguage.googleapis.com" },
+ httpOptions: { baseUrl: "https://api.impossibl.com" },
});

const response = await ai.models.generateContent({
  model: "gemini-2.5-flash",
  contents: "hello",
});
```

#### ai sdk

```diff
import { createOpenAI } from "@ai-sdk/openai";
import { generateText } from "ai";

const apiKey = process.env.IMPOSSIBL_API_KEY;
if (!apiKey) throw new Error("IMPOSSIBL_API_KEY is not set");

const gateway = createOpenAI({
  apiKey,
- baseURL: "https://api.openai.com/v1",
+ baseURL: "https://api.impossibl.com/v1",
});

const { text } = await generateText({
  model: gateway("anthropic/claude-fable-5"),
  prompt: "hello",
});
```

## frequently asked questions

man impossibl

### what is the ai api?

one openai-compatible api that sits in front of openai, anthropic, google and xai. you pick the model, we route the request and handle the billing. one key for every provider.

### why use the ai api instead of going direct?

one api, one key, one balance for every provider. switching models is just editing a string, and if a provider fails before the first token we retry the next route for you. going direct means a separate sdk, key and invoice per provider, plus a migration every time a better model ships.

### how is pricing calculated?

usage is charged at the provider's list price with 0% usage markup. prepaid credit purchases include a 5% platform fee. there is no subscription. usage comes off your balance when the request finishes.

### what if i already have credits or a contract with a provider?

just bring your key. add your openai, anthropic, google, xai, bedrock or azure key once and matching requests go through it at zero credit cost, billed straight to your provider account. startup credits and negotiated rates keep working, and you still get one api for everything.

### how does agent onboarding work?

paste the setup prompt into your agent. it reads auth.md, creates an ai api account, generates an api key and connects your app. claiming is optional: open the complete claim link it gives you to attach the account to your identity, unlock the dashboard and get an extra $1 in usage credits. the agent's key keeps working after the claim.

### my agent created an account for me. how do i claim it?

ask your agent for the complete claim link. open it, sign in and confirm the handoff. the link already includes the 6-digit code, so you don't have to copy it. that attaches the account to your identity, unlocks the dashboard and adds $1 in usage credits — once per person. nothing breaks in the meantime: the agent's api key keeps working before, during and after the claim.

### will the ai api work with my existing stack?

almost certainly. we speak openai chat completions, openai responses and anthropic messages, so the openai and anthropic sdks work as is, and so does anything built on top of them, like the ai sdk. moving over is a base url swap, not a rewrite.

### how do i integrate?

change one line. point your openai or anthropic sdk at ` api.impossibl.com/v1 ` and swap the key. chat completions, responses and the messages api all work unchanged. models are ` provider/model ` strings, and ` get /v1/models ` lists every one with live pricing.

more in the [docs →](<https://impossibl.com/docs>)

## ship the impossibl.

```text
read https://impossibl.com/auth.md and set me up.
```

paste into your agent

---

2261 market street ste 85136  
san francisco, ca 94114

[Discord](<https://discord.gg/YpZNgcmFPK>) · [X](<https://x.com/impossiblAI>)

### ai api

- [docs](<https://impossibl.com/docs>)
- [models](<https://impossibl.com/models>)
- [console](<https://impossibl.com/dashboard>)
- [changelog](<https://impossibl.com/changelog>)

### open source

- [ultracontext](<https://github.com/ultracontext/ultracontext>)

### company

- [about](<https://impossibl.com/about>)
- [humans](<https://impossibl.com/humans>)
- [brand](<https://impossibl.com/brand>)
- [contact](<mailto:f@impossibl.com>)

© 2026 impossibl, inc. · [terms](<https://impossibl.com/terms>) · [privacy](<https://impossibl.com/privacy>)
