SDKs

Official client libraries for the Agent API
View as Markdown

Use the official Agent API SDKs to call chat completions, corpus search, evaluators, CTAs, and other endpoints from your application.

Generated with Fern from the same OpenAPI definition as the API Reference.

TypeScript / JavaScript

npm install apologist
import { ApologistAgentClient } from "apologist";
const client = new ApologistAgentClient({
domain: process.env.APOLOGIST_AGENT_DOMAIN,
apiKey: process.env.APOLOGIST_API_KEY,
});

Package: https://www.npmjs.com/package/apologist

Class: ApologistAgentClient

Repository: apologist-project/apg-sdk-js

Python

pip install apologist
import os
from apologist import ApologistAgentClient
client = ApologistAgentClient(
domain=os.environ["APOLOGIST_AGENT_DOMAIN"],
api_key=os.environ["APOLOGIST_API_KEY"],
)

Package: https://pypi.org/project/apologist/

Class: ApologistAgentClient

Repository: apologist-project/apg-sdk-python

Go

go get github.com/apologist-project/apg-sdk-go
import (
"os"
"github.com/apologist-project/apg-sdk-go/client"
"github.com/apologist-project/apg-sdk-go/option"
)
c := client.NewApologistAgentClient(
option.WithDomain(os.Getenv("APOLOGIST_AGENT_DOMAIN")),
option.WithAPIKey(os.Getenv("APOLOGIST_API_KEY")),
)

Package: https://pkg.go.dev/github.com/apologist-project/apg-sdk-go

Class: client.ApologistAgentClient

Repository: apologist-project/apg-sdk-go

Java

Maven coordinate: ai.apologist:apologist

import ai.apologist.AgentClient;
AgentClient client = AgentClient.builder()
.domain(System.getenv("APOLOGIST_AGENT_DOMAIN"))
.apiKey(System.getenv("APOLOGIST_API_KEY"))
.build();

Package: https://central.sonatype.com/artifact/ai.apologist/apologist

Class: ai.apologist.AgentClient

Repository: apologist-project/apg-sdk-java

.NET / C#

dotnet add package apologist
using Apologist;
var client = new ApologistAgentClient(
Environment.GetEnvironmentVariable("APOLOGIST_API_KEY")!,
new ClientOptions
{
Domain = Environment.GetEnvironmentVariable("APOLOGIST_AGENT_DOMAIN"),
}
);

Package: https://www.nuget.org/packages/apologist

Class: Apologist.ApologistAgentClient

Repository: apologist-project/apg-sdk-csharp

PHP

composer require apologist/apologist
<?php
use Apologist\ApologistAgentClient;
$client = new ApologistAgentClient(
apiKey: getenv('APOLOGIST_API_KEY') ?: null,
domain: getenv('APOLOGIST_AGENT_DOMAIN') ?: null,
);

Package: https://packagist.org/packages/apologist/apologist

Class: Apologist\ApologistAgentClient

Repository: apologist-project/apg-sdk-php

Ruby

gem install apologist
require "apologist"
client = Apologist::AgentClient.new(
api_key: ENV.fetch("APOLOGIST_API_KEY"),
domain: ENV.fetch("APOLOGIST_AGENT_DOMAIN"),
)

Package: https://rubygems.org/gems/apologist

Class: Apologist::AgentClient

Repository: apologist-project/apg-sdk-ruby

Swift

// Package.swift dependency:
.package(url: "https://github.com/apologist-project/apg-sdk-swift.git", from: "0.1.0")
import Foundation
import Apologist
guard
let domain = ProcessInfo.processInfo.environment["APOLOGIST_AGENT_DOMAIN"],
let apiKey = ProcessInfo.processInfo.environment["APOLOGIST_API_KEY"]
else {
fatalError("APOLOGIST_AGENT_DOMAIN and APOLOGIST_API_KEY are required")
}
let client = ApologistAgentClient(
baseURL: "https://\(domain)/api/v1",
apiKey: apiKey
)

Class: ApologistAgentClient

Repository: apologist-project/apg-sdk-swift

Rust

cargo add apologist
use apologist::prelude::*;
use std::env;
let domain = env::var("APOLOGIST_AGENT_DOMAIN").expect("APOLOGIST_AGENT_DOMAIN");
let api_key = env::var("APOLOGIST_API_KEY").expect("APOLOGIST_API_KEY");
let config = ClientConfig {
base_url: format!("https://{domain}/api/v1"),
api_key: Some(api_key),
..Default::default()
};
let client = ApologistAgentClient::new(config).expect("Failed to build client");

Package: https://crates.io/crates/apologist

Class: ApologistAgentClient

Repository: apologist-project/apg-sdk-rust

Next Steps

Browse the API Reference for endpoint details. Endpoint pages include SDK snippets for supported languages once generation has run.