Skip to main content
This guide walks you through everything you need to go from zero to your first successful API response. By the end, you’ll have a working request you can paste straight into your project.

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 choices array. Here’s what a typical response looks like:
The model’s reply is in choices[0].message.content. The usage object tells you how many tokens were consumed — useful for monitoring costs.
You can use the official OpenAI SDK with Swytcho by pointing the base_url (Python) or baseURL (Node.js) to https://api.swytcho.com/v1 and passing your Swytcho API key. No other changes are needed, and you get full access to streaming, function calling, and embeddings through the SDK’s familiar interface.
Python (OpenAI SDK)