Swap one URL, keep your code.
the whole migration
- base_url = "https://api.openai.com/v1"+ base_url = "https://api.prima.li/v1" A complete example
Before
client = OpenAI(
base_url=OPENAI,
api_key=key,
)
client.chat.completions.create(...)After
client = OpenAI(
base_url=PRIMA,
api_key=key,
)
client.chat.completions.create(...)What stays identical
- Request shape
- identical
- Response shape
- identical
- Streaming
- identical
- Error format
- identical
- Model naming
- not confirmed yet
What is different
- Model availability
- not documented yet
- Anything not at parity
- not documented yet
- Latency from Swiss hosting
- not measured yet
Nothing is listed here yet. That means it has not been written down, not that there is nothing to write. Treat this list as incomplete until it is filled in.
Verify it worked
two calls
$ curl api.prima.li/models -H "Authorization: Bearer $PRIMA_KEY"
# then check your own meter
$ curl api.prima.li/usage -H "Authorization: Bearer $PRIMA_KEY" Turn on memoryoptional
Point the integration at a stone repository.