# IApiReferenceExporter

- Kind: `interface`
- Package: [Aspire.TypeSystem](/reference/api/csharp/aspire.typesystem.md)
- Version: `13.6.0`
- Namespace: `Aspire.TypeSystem`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.TypeSystem/IApiReferenceExporter.cs)

Optional companion to [ICodeGenerator](/reference/api/csharp/aspire.typesystem/icodegenerator.md) for languages that can describe their generated surface as a machine-readable API reference.

## Definition

```csharp
namespace Aspire.TypeSystem;

public interface IApiReferenceExporter
{
    // ...
}
```

## Remarks

Code generation and API export answer different questions. [ICodeGenerator](/reference/api/csharp/aspire.typesystem/icodegenerator.md) produces the source a user compiles against; this interface produces the documentation model that describes that source. Keeping them separate means a language provider can ship runnable code generation long before it can describe it, and documentation tooling can tell the difference instead of publishing a silently empty reference.

The payload schema is owned by the language provider. Hosts must pass the returned document through unmodified so language-specific details survive transport.

## Properties

- [Language](/reference/api/csharp/aspire.typesystem/iapireferenceexporter/properties.md#language) : `string` `abstract` `get` -- Gets the target language name (for example, "TypeScript"). This must match the [ICodeGenerator.Language](/reference/api/csharp/aspire.typesystem/icodegenerator/properties.md#language) value of the generator that produces the same surface, so a host can resolve one from the other.

## Methods

- [ExportApi(AtsContext, ApiReferenceExportOptions, CancellationToken)](/reference/api/csharp/aspire.typesystem/iapireferenceexporter/methods.md#exportapi-atscontext-apireferenceexportoptions-cancellationtoken) : `JsonElement` `abstract` -- Exports the API reference for the surface the generator would produce from the same context.
