Skip to content

Recipes

Recipe What it shows Run it
python-sdk The official Python SDK python example.py
openai-python The OpenAI Python SDK with a FreeTheAI base URL python example.py
js-sdk The official JavaScript SDK npm install && npm start
openai-node The OpenAI Node SDK with a FreeTheAI base URL npm install && npm start
go-sdk The official Go SDK go mod tidy && go run .
curl Raw HTTP requests bash examples.sh
streaming Replies printed as they arrive python stream.py
tool-calling A model that calls a local function python tools.py
web-search-answers Web search and sourced answers python search.py "question"
langchain ChatOpenAI with a custom base_url python chat.py
llamaindex OpenAILike with a custom api_base python chat.py
vercel-ai-sdk createOpenAICompatible with the Vercel AI SDK npm install && npm start
rag-local-files A small retrieval-augmented answer over your files python rag.py ./notes "question"
structured-output JSON output that your code parses python json_output.py
chat-cli A tiny chat program for the terminal python chat.py

Every recipe needs FREETHEAI_API_KEY in the environment. Each one makes only a few requests, so a run uses a small part of the free daily allowance.