Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Cody

Scalekit connector
Open markdown

The Cody connector lets your AI agent act in each user's Cody account. Each user connects their own Cody access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 18 tools.

Tools
18
What they doRead · write · destructive
9 · 7 · 29 read7 write2 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Cody connection

    In AgentKit > Connections, create a Cody connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'cody'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Cody:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'cody_bots_list',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Cody credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • cody_bots_listList the AI bots in the Cody account, optionally filtered by name.Read-only

    List Bots

    List the AI bots in the Cody account, optionally filtered by name. Returns each bot's id, name, model and created_at. Use this to find a bot ID for Create Conversation. Bots are created in the Cody dashboard, not through the API.

    Inputs

    keywordstring
    Only return items whose name at least partially matches this text. Example: support.
  • cody_conversation_getGet one Cody conversation by ID.Read-only

    Get Conversation

    Get one Cody conversation by ID. Returns its id, name, bot_id and created_at, plus focused document IDs when requested. Use List Messages for its messages.

    Inputs

    conversation_idstringrequired
    ID of the conversation. Find it with List Conversations. Example: Cv7Mn2Bq8Tz4.
    includesstring
    Set to document_ids to include the IDs of the documents the conversation is focused on. Example: document_ids.one of document_ids
  • cody_conversations_listList conversations in the Cody account, optionally filtered by bot or name.Read-only

    List Conversations

    List conversations in the Cody account, optionally filtered by bot or name. Returns each conversation's id, name, bot_id and created_at, plus focused document IDs when requested. Use this to find a conversation. Use List Messages for the messages in one conversation.

    Inputs

    bot_idstring
    Only return conversations that use this bot ID, from List Bots. Example: Xb8Lq3mN5pRw.
    includesstring
    Set to document_ids to include the IDs of the documents each conversation is focused on. Example: document_ids.one of document_ids
    keywordstring
    Only return items whose name at least partially matches this text. Example: support.
  • cody_document_getGet one document from the Cody knowledge base by ID.Read-only

    Get Document

    Get one document from the Cody knowledge base by ID. Returns its id, name, status, folder_id, content_url and created_at. Use List Documents to find the ID.

    Inputs

    document_idstringrequired
    ID of the document. Find it with List Documents. Example: Dc4Kp8Wn2Qx6.
  • cody_documents_listList documents in the Cody knowledge base, filtered by folder, conversation focus or name.Read-only

    List Documents

    List documents in the Cody knowledge base, filtered by folder, conversation focus or name. Returns each document's id, name, status, folder_id and content_url. Use this to find a document ID. Use Get Document for one document.

    Inputs

    conversation_idstring
    Only return documents the given conversation is focused on. Example: Cv7Mn2Bq8Tz4.
    folder_idstring
    Only return documents in this folder ID, from List Folders. Example: Fk2Lm9Qp4Xs7.
    keywordstring
    Only return documents whose name at least partially matches this text. Example: support.
  • cody_folder_getGet one Cody knowledge-base folder by ID.Read-only

    Get Folder

    Get one Cody knowledge-base folder by ID. Returns its id, name and created_at. Use List Documents with the folder ID to see its documents.

    Inputs

    folder_idstringrequired
    ID of the folder. Find it with List Folders. Example: Fk2Lm9Qp4Xs7.
  • cody_folders_listList the folders of the Cody knowledge base, optionally filtered by name.Read-only

    List Folders

    List the folders of the Cody knowledge base, optionally filtered by name. Returns each folder's id, name and created_at. Use this to find a folder ID for Create Document or List Documents.

    Inputs

    keywordstring
    Only return items whose name at least partially matches this text. Example: support.
  • cody_message_getGet one Cody message by ID.Read-only

    Get Message

    Get one Cody message by ID. Returns its id, content, machine flag, conversation_id and created_at, plus sources or token usage when requested. Use List Messages to find the ID.

    Inputs

    message_idstringrequired
    ID of the message. Find it with List Messages. Example: Ms3Jk7Lp1Vb9.
    includesstring
    Extra attributes to include: sources (knowledge-base documents used for the answer) or usage (tokens and credits used). Example: sources.one of sourcesusage