Start here
This guide is for people who have never used an API. Every step is planned: the API does not exist yet, so nothing here works today. It will read the same when it does.
What an API is
plannedAn API is a counter you order from. You send a request, such as a question. The service sends back a response, such as an answer. A chat app does this for you. With an API you do it yourself, or you let another app do it for you.
What you should see: nothing. This step is vocabulary.
Join the waitlist and get a key
planned. When a model exists, you will get an email with a link to create an account and a key. A key is a long string of characters that says who is asking and who gets billed.
What you should see: an email, and a key that starts with
ab-.Keep the key private
plannedTreat the key like a password. Do not post it, commit it to a public repository or send it to anyone. If it leaks, delete it in your account and make a new one. Anyone with your key spends your credits.
What you should see: the key in a password manager or an environment variable, and nowhere else.
Send a first request with curl
plannedcurl is a command-line tool that sends requests. It comes with macOS, most Linux systems and recent Windows.
curl https://api.abliterate.app/v1/chat/completions \ -H "Authorization: Bearer ab-demo-not-a-real-key" \ -H "Content-Type: application/json" \ -d '{"model": "abliterate-sonny-v2.5", "messages": [{"role": "user", "content": "Say hello."}]}'What you should see: a block of text. The reply is under
choices, thenmessage, thencontent.Do the same in Python
plannedInstall the library with
pip install openai, then run the sample from the home page with your own key.What you should see: the reply, printed in your terminal.
Connect an app
plannedSillyTavern and Open WebUI both accept a custom OpenAI-compatible endpoint. In the connection settings choose the OpenAI-compatible option, paste
https://api.abliterate.app/v1as the base URL, add your key and pick a model id such asabliterate-sonny-v2.5.What you should see: the model in the app's model list, answering when you type to it.
When something goes wrong
planned- 401
- the key is missing or wrong. Check it.
- 402
- you are out of credits. Top up.
- 404
- the model id is misspelled. Copy it from the models page.
- 429
- too many requests. Wait a moment and try again.
- 5xx
- a problem on the service side. Try again in a minute, then check the status page.
If every request fails and the status page says the API is planned, that is why.
Join the waitlist.
One email to confirm, one when a model exists. The second may take a while.