Skip to content

Client Creation

Basic example showing how to create a Nomic AI client.

This example assumes using Nomic; is in scope and apiKey contains your Nomic API key.

1
2
3
4
5
6
7
8
// Create a Nomic AI client using an API key from the environment.
using var client = new NomicClient(apiKey);

// Generate a simple text embedding to verify the client works.
var response = await client.EmbedTextAsync(
    texts: ["Hello, world!"],
    model: TextEmbeddingRequestModel.NomicEmbedTextV15,
    taskType: TextEmbeddingRequestTaskType.SearchDocument);