Syntic

Your first Syntic API request

Send a chat request to the Syntic API with curl and read the reply.

Product
Developers
Level
Intermediate
Time
8 minutes
Works in
Syntic API
Reviewed
16 Oct 2026

What you will accomplish

  • Call the chat completions endpoint
  • Read the answer from the response
  • Know how streaming works

Before you start

  • A private API key in the SYNTIC_API_KEY environment variable (see Create an API key)
  • A terminal with curl
  1. Step 1: Send a request

    Call POST https://app.syntic.ai/v1/chat/completions with your key as a Bearer token. Name the model, set stream, and pass the conversation as messages.

    curl -sS https://app.syntic.ai/v1/chat/completions \
      -H "Authorization: Bearer $SYNTIC_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "Amara Deep",
        "stream": false,
        "messages": [
          { "role": "system", "content": "Answer in one sentence." },
          { "role": "user", "content": "Why do onions make people cry?" }
        ]
      }'
  2. Step 2: Read the reply

    The answer is in choices[0].message.content of the JSON response.

  3. Step 3: Decide on streaming

    Always send stream explicitly. If you leave it out the API streams by default, and the reply arrives as a series of data: lines instead of one JSON object. Set "stream": true when you want to show the answer as it's written.

  4. Step 4: When something fails

    Every error response carries an x-syntic-request-id header. Include it when you contact support.

Tips

  • The full reference (models, parameters and the streaming format) is in the developer docs.

Next step

Build with the Syntic API · Lesson 3 of 3

Using Syntic CLI Remote Control

Related tutorials