Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# @lightchain/sdk
# @lightchainai/sdk

The LightChain AI Developer API for TypeScript: it runs an API key against the right network, and, given a wallet, pays a `402` by itself. Completions go through the OpenAI SDK: the Developer API is OpenAI-compatible.

```sh
npm install @lightchain/sdk openai
npm install @lightchainai/sdk openai
```

## 1. Create a key in the chat: Developer → API keys
Expand All @@ -14,7 +14,7 @@ The chat's Developer page (`/developer`) creates your API keys and lists them. A

```ts
import OpenAI from "openai";
import { Lightchain } from "@lightchain/sdk";
import { Lightchain } from "@lightchainai/sdk";

const lc = new Lightchain({ network: "testnet", apiKey: process.env.LIGHTCHAIN_API_KEY! });
const openai = new OpenAI({ baseURL: lc.baseURL, apiKey: lc.apiKey, fetch: lc.fetch });
Expand Down Expand Up @@ -61,7 +61,7 @@ With `payment: "x402"`, the SDK pays each call from the account's own prepaid ba
```ts
import OpenAI from "openai";
import { privateKeyToAccount } from "viem/accounts";
import { Lightchain, type LightchainJob } from "@lightchain/sdk";
import { Lightchain, type LightchainJob } from "@lightchainai/sdk";

const lc = new Lightchain({
network: "testnet",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"name": "@lightchain/sdk",
"name": "@lightchainai/sdk",
"version": "0.1.0-alpha.0",
"description": "The LightChain AI Developer API with an API key, through the OpenAI SDK; a wallet can top up on a 402 by itself, or pay per request with x402.",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/lightchain-protocol/lightchain-sdk.git"
},
"type": "module",
"exports": {
".": {
Expand Down
Loading