BuildQuickstarts by language

Quickstarts by language

Each quickstart takes you from an empty folder to a working program in one language: install, send a request, add instructions, stream the reply, call a function, and handle errors. All of them call the same endpoint:

POST https://app.syntic.ai/v1/chat/completions
Authorization: Bearer $SYNTIC_API_KEY
Content-Type: application/json
LanguageApproachPage
Shellcurl and jqcurl
Pythonrequests, or the openai library with a custom base URLPython
JavaScript / TypeScriptBuilt-in fetch, or the openai package with a custom base URLJavaScript and TypeScript
Gonet/http from the standard libraryGo
Javajava.net.http.HttpClient with JacksonJava
C# / .NETHttpClient with System.Text.JsonC#
PHPext-curlPHP
RubyNet::HTTP from the standard libraryRuby

Before you start

  1. Create a private API key in the Console under Settings β†’ API Keys. See Get an API key.

  2. Put it in an environment variable so it never appears in your code:

    export SYNTIC_API_KEY="sk_live_..."      # macOS / Linux
    setx SYNTIC_API_KEY "sk_live_..."        # Windows (new terminals pick it up)

Three things every quickstart handles

  • Streaming is on by default. Leave stream out and the reply arrives as server-sent events. Every quickstart sets "stream": false for the simple request and shows streaming separately. If you use an OpenAI-compatible library, make sure non-streaming calls actually send stream: false; libraries often leave the field out.
  • Model names are exact strings with spaces and capitals: Amara S1.2, Amara Quick. An unknown name is answered by the default model rather than rejected. See Models overview.
  • Errors have a flat body: {"error": "invalid_api_key"}. Branch on the HTTP status and the error string. See Error codes.

Official Syntic client libraries are planned for these languages; see Other languages. The code on these pages keeps working when they ship.

Was this page helpful?