Prerequisites
Before you begin, make sure you have the following:- A Swytcho account — sign up for free at swytcho.com if you haven’t already.
- Your API key — you’ll generate this in Step 1 below.
- A terminal or API client (curl, Python 3.7+, or Node.js 18+).
1
Create your account and navigate to API Keys
Go to swytcho.com and sign up for a free account. Once you’re logged in, open the dashboard and click API Keys in the left sidebar. Then click Create new key, give it a descriptive name (for example,
my-first-key), and confirm.2
Copy your API key and store it securely
Your new API key is shown only once — copy it immediately and store it somewhere safe, such as a password manager or a
.env file in your project. You’ll use this key to authenticate every request you send to Swytcho.Never commit your API key to source control. Add
.env to your .gitignore before you paste the key anywhere in your project directory.3
Make your first API call
Send a
POST request to the chat completions endpoint. The request body follows the same format as OpenAI’s chat completions API, so any existing OpenAI-compatible code works with minimal changes.4
Read the response
A successful request returns a JSON object that contains the model’s reply inside the The model’s reply is in
choices array. Here’s what a typical response looks like:choices[0].message.content. The usage object tells you how many tokens were consumed — useful for monitoring costs.