> ## Documentation Index
> Fetch the complete documentation index at: https://docs.smartlyq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SDKs & CLI

> Official SmartlyQ client libraries for Node.js, Python, Go, and PHP - plus a CLI and a chatbot adapter.

Official client libraries for the SmartlyQ API. Every SDK covers the **full API surface** - social posting and scheduling, AI content generation (articles, images, video, audio, presentations), SEO research, CRM, chatbots, profiles, workspaces, and more - with the same resource-based method names in every language.

All SDKs are generated from the [OpenAPI spec](https://docs.smartlyq.com/openapi.json) and republish automatically when the API gains new endpoints, so they are never behind the API Reference.

## Official SDKs

<CardGroup cols={2}>
  <Card title="Node.js" icon="node-js" href="/sdks/node">
    `npm install @smartlyqofficial/node`

    TypeScript types for every request and response. Zero dependencies, native fetch, Node 18+.
  </Card>

  <Card title="Python" icon="python" href="/sdks/python">
    `pip install smartlyq`

    Clean snake\_case client on httpx. Context-manager friendly, Python 3.9+.
  </Card>

  <Card title="Go" icon="golang" href="/sdks/go">
    `go get github.com/SmartlyQ/smartlyq-go`

    Context-first, standard library only, zero dependencies. Go 1.22+.
  </Card>

  <Card title="PHP" icon="php" href="/sdks/php">
    `composer require smartlyq/sdk`

    PSR-4, zero runtime dependencies, PHP 8.1+.
  </Card>

  <Card title="CLI" icon="terminal" href="/sdks/cli">
    `npm install -g @smartlyqofficial/cli`

    Every API operation as a shell command - perfect for scripts, cron jobs, and CI.
  </Card>

  <Card title="Chat SDK Adapter" icon="comments" href="/sdks/chat-sdk-adapter">
    `npm install @smartlyqofficial/chat-sdk-adapter`

    Build a multi-platform chatbot on the unified inbox. Write once - works on every connected platform.
  </Card>
</CardGroup>

## One surface, every language

The method names mirror each other across every SDK - learn it once, use it anywhere:

<CodeGroup>
  ```typescript Node.js theme={null}
  import SmartlyQ from '@smartlyqofficial/node';

  const sq = new SmartlyQ({ apiKey: process.env.SMARTLYQ_API_KEY });

  const post = await sq.social.createPost({
    text: 'Hello from SmartlyQ!',
    account_ids: ['acc_123'],
  });
  ```

  ```python Python theme={null}
  from smartlyq import SmartlyQ

  sq = SmartlyQ()  # reads SMARTLYQ_API_KEY

  post = sq.social.create_post({
      "text": "Hello from SmartlyQ!",
      "account_ids": ["acc_123"],
  })
  ```

  ```go Go theme={null}
  client := smartlyq.NewClient("") // reads SMARTLYQ_API_KEY

  post, err := client.Social.CreatePost(ctx, map[string]any{
  	"text":        "Hello from SmartlyQ!",
  	"account_ids": []string{"acc_123"},
  }, nil)
  ```

  ```php PHP theme={null}
  $sq = new Smartlyq\SmartlyQ(); // reads SMARTLYQ_API_KEY

  $post = $sq->social->createPost([
      'text' => 'Hello from SmartlyQ!',
      'account_ids' => ['acc_123'],
  ]);
  ```

  ```bash CLI theme={null}
  smartlyq social create-post \
    --data '{"text":"Hello from SmartlyQ!","account_ids":["acc_123"]}'
  ```
</CodeGroup>

## Building an AI agent instead?

<Card title="MCP Server" icon="plug" href="/mcp-server">
  The hosted **Model Context Protocol** server exposes the same API as tools for Claude, Cursor, ChatGPT, and any MCP client - usually the fastest integration for agents. The SDKs are the right choice when you are writing code.
</Card>

## Shared behavior

Every SDK ships the same batteries:

* **Authentication** via `Authorization: Bearer sqk_live_...` - pass the key to the constructor or set the `SMARTLYQ_API_KEY` environment variable.
* **Automatic retries** with exponential backoff on `429` and `5xx`, honoring `Retry-After`.
* **Idempotency keys** for safely retrying writes.
* **Profile scoping** - act on behalf of a managed [Profile](/guides/profiles) by setting the profile option (sent as `X-Profile-Id`).
* **Typed errors** carrying the HTTP status, error `code`, message, and `request_id` for support.
* **Sandbox keys** (`sqk_test_...`) work everywhere - simulated responses, no charges.
