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

# Backend

> Create conversations, characters, and knowledge bases from your server using the Node.js or Python SDK.

Your backend is the only place that should hold your Equos API key. It's responsible for:

* Creating **characters**, **knowledge bases**, and other resources
* Starting **conversations** and forwarding the credentials to the client
* Stopping conversations when you're done

Equos offers two backend SDKs—pick whichever fits your stack.

<CardGroup cols={2}>
  <Card icon="node" title="@equos/node-sdk" href="/sdks/nodejs">NPM package for Node.js (and any JS runtime).</Card>
  <Card icon="python" title="equos" href="/sdks/python">Pip package with sync and async clients.</Card>
</CardGroup>

***

## Start a conversation

The most common backend operation: create a conversation for a given character, and return the credentials the client needs to join.

<CodeGroup>
  ```ts Node.js theme={null}
  import { EquosClient } from "@equos/node-sdk";

  const client = EquosClient.create(process.env.EQUOS_API_KEY!);

  const { conversation, consumerAccessToken } =
    await client.conversations.startConversation({
      createEquosConversationRequest: {
        name: "Demo conversation",
        characterId: process.env.EQUOS_CHARACTER_ID!,
        consumer: { name: "Demo User", identity: "demo-user" },
      },
    });

  // Send these three fields to your client:
  // - conversation.serverUrl        (LiveKit WebSocket URL)
  // - consumerAccessToken            (short-lived JWT)
  // - conversation.character.livekitIdentity
  ```

  ```python Python theme={null}
  import os
  from equos import EquosClient
  from equos.models import CreateEquosConversationRequest, EquosParticipantIdentity

  client = EquosClient(api_key=os.environ["EQUOS_API_KEY"])

  response = client.conversations.start(
      CreateEquosConversationRequest(
          name="Demo conversation",
          character_id=os.environ["EQUOS_CHARACTER_ID"],
          consumer=EquosParticipantIdentity(name="Demo User", identity="demo-user"),
      )
  )

  # Send these three fields to your client:
  # - response.conversation.server_url
  # - response.consumer_access_token
  # - response.conversation.character.livekit_identity
  ```
</CodeGroup>

<Warning>
  Never expose `EQUOS_API_KEY` to the client. Only the `conversation` object and `consumerAccessToken` should cross the wire.
</Warning>

## Stop a conversation

<CodeGroup>
  ```ts Node.js theme={null}
  await client.conversations.stopConversation({ id: conversation.id });
  ```

  ```python Python theme={null}
  client.conversations.stop(response.conversation.id)
  ```
</CodeGroup>

***

## Manage other resources

The same client can create and manage every resource in your organization: **characters**, **knowledge bases**, **voices**, and more. See the SDK pages for the full API surface:

<CardGroup cols={2}>
  <Card icon="node" title="Node.js SDK reference" href="/sdks/nodejs">Install, client init, full API.</Card>
  <Card icon="python" title="Python SDK reference" href="/sdks/python">Install, client init, sync + async.</Card>
</CardGroup>

***

## Full examples

<CardGroup cols={2}>
  <Card icon="github" title="Node.js example" href="https://github.com/EquosAI/equos-examples/tree/main/examples/equos-nodejs-integration">
    Complete Node.js project creating characters, knowledge bases, and conversations.
  </Card>

  <Card icon="github" title="Python example" href="https://github.com/EquosAI/equos-examples/tree/main/examples/equos-python-integration">
    Sync and async Python scripts for the same flows.
  </Card>
</CardGroup>

## Next step

Once your backend is returning a conversation payload, wire it up to a client:

<CardGroup cols={2}>
  <Card icon="browser" title="Web client" href="/integration/web">Connect from a browser using the Browser SDK or React SDK.</Card>
  <Card icon="mobile" title="Native client" href="/integration/native">Connect from iOS or Android using LiveKit.</Card>
</CardGroup>
