SDK
Purpose
The ApiMapper SDK lets application developers integrate with the Runtime without writing any MCP or HTTP plumbing. It handles session management, credential injection, tool pagination, and system prompt fetching. The calling code only needs to call three methods: get the system prompt, get the tools, and invoke a tool.
What The SDK Does
The SDK provides client libraries in four languages — .NET, TypeScript, Python, and Java — that all expose the same conceptual interface:
- Get system prompt — fetches the effective system prompt from the Runtime and caches it for the lifetime of the client
- Get tools — loads the full tool catalog published by the Runtime, handling MCP pagination internally
- Invoke tool — calls a single tool by name and returns its result
In addition, each language provides orchestrator adapters that convert the tool list into the native format expected by popular AI frameworks: Microsoft.Extensions.AI, Semantic Kernel, Azure AI Foundry Agents, OpenAI, LangChain, LangGraph, and Spring AI.
Authentication
The SDK supports three authentication modes. The choice is made once at registration time — all subsequent calls use it transparently.
| Mode | When to use |
|---|---|
| API key | Simplest option; key issued from the ApiMapper Portal; no IdP required |
| OAuth2 client credentials | Machine-to-machine; SDK fetches and refreshes tokens from an IdP automatically |
| Delegated bearer token | Token already held by the orchestrator or request pipeline; forwarded as-is |
System Prompt Injection
Every example and orchestrator adapter follows the same pattern: fetch the system prompt first, then inject it as the system message before sending any message to the LLM. The Runtime computes the effective prompt per tenant and client application, so different callers can receive different prompts from the same toolset.
Functional Capabilities
Quick Start
.NET
dotnet add package CodedProjects.AI.ApiMapper.Client
builder.Services
.AddApiMapperClient(opts =>
{
opts.BaseUrl = configuration["ApiMapper:BaseUrl"];
opts.TenantId = Guid.Parse(configuration["ApiMapper:TenantId"]);
opts.ClientId = "my-app";
opts.SystemPromptResourceUri = "apimapper://toolsets/system-prompt";
})
.WithApiKey(configuration["ApiMapper:ApiKey"]);
// In your service or endpoint:
var systemPrompt = await client.GetSystemPromptAsync();
var tools = await client.GetToolsAsync();
var result = await client.InvokeToolAsync("tool_name", new { param = "value" });
TypeScript
npm install @codedprojects/api-mapper-client
const client = new ApiMapperClient({
baseUrl: process.env.APIMAPPER_BASE_URL!,
tenantId: process.env.APIMAPPER_TENANT_ID!,
clientId: "my-app",
systemPromptResourceUri: "apimapper://toolsets/system-prompt",
credentials: new ApiKeyCredentialProvider(process.env.APIMAPPER_API_KEY!),
logger: console,
});
const systemPrompt = await client.getSystemPrompt();
const tools = await client.getTools();
const result = await client.invokeTool("tool_name", { param: "value" });
Python
pip install api-mapper-client
async with ApiMapperClient(ApiMapperClientOptions(
base_url=os.getenv("APIMAPPER_BASE_URL"),
tenant_id=uuid.UUID(os.getenv("APIMAPPER_TENANT_ID")),
client_id="my-app",
system_prompt_resource_uri="apimapper://toolsets/system-prompt",
credentials=ApiKeyCredentialProvider(os.getenv("APIMAPPER_API_KEY")),
)) as client:
system_prompt = await client.get_system_prompt()
tools = await client.get_tools()
result = await client.invoke_tool("tool_name", {"param": "value"})
Java
<dependency>
<groupId>com.codedprojects</groupId>
<artifactId>api-mapper-client</artifactId>
<version>1.0.0</version>
</dependency>
var opts = ApiMapperClientOptions.builder()
.baseUrl(System.getenv("APIMAPPER_BASE_URL"))
.tenantId(UUID.fromString(System.getenv("APIMAPPER_TENANT_ID")))
.clientId("my-app")
.systemPromptResourceUri("apimapper://toolsets/system-prompt")
.credentials(new ApiKeyCredentialProvider(System.getenv("APIMAPPER_API_KEY")))
.build();
try (var client = new ApiMapperClient(opts)) {
var systemPrompt = client.getSystemPrompt().get();
var tools = client.getTools().get();
var result = client.invokeTool("tool_name", Map.of("param", "value")).get();
}
