Skip to main content
Generating an artifact involves making an API call to a dedicated C1 endpoint. This is done using a standard OpenAI client library, configured to connect to the C1 Artifacts service.

Configuring the API Client

To begin, initialize your OpenAI client to use the C1 Artifacts endpoint and your Thesys API key. Artifact API Endpoint: https://api.thesys.dev/v1/artifact
You can create a new API key from Developer Console.

Structuring the Request

The API call’s payload has two main parts:
  • messages array for your prompt
  • metadata object for C1-specific instructions.

The messages Array

This is where you provide the prompt to generate the artifact. The content of the user message can include rich context, like data or a detailed description of the desired output. You can also include a system prompt to provide high-level instructions.

The metadata Object

This object provides C1-specific instructions for the generation. It must contain a thesys key, whose value is a stringified JSON object. Inside the thesys object, the c1_artifact_type property tells C1 what kind of artifact to generate, for example 'slides' or 'report'.

Full Example: Generating Slides

This example brings the concepts together to generate a slide deck from a prompt. The artifact variable in the response will contain the C1 DSL string, which is ready to be sent to your frontend for rendering.
src/app/api/generate-slides/route.ts