| name | neta-developer |
| description | Help developers build single-page applications on the Neta Open Platform. Covers OAuth2 PKCE, API integration, and SPA architecture. |
| when_to_use | Use when the user registers a developer app, implements Neta authentication, calls platform APIs, or extends the demo SPA. |
| allowed-tools | Read |
Neta Developer Skill
Help developers build third-party SPAs on the Neta Open Platform.
Neta is operated by Viscept Limited.
| Service | URL |
|---|
| Official site | https://www.neta.art |
| Main app | https://app.neta.art |
| OAuth service | https://auth.neta.art |
| Backend API | https://api.talesofai.com |
| LLM gateway | https://litellm.talesofai.com |
| Cohub (AI agent platform) | https://cohub.run |
Developer access
To become a Neta developer, contact staff via Discord: https://discord.com/channels/1196028153085296651/1497137199001501768
Once granted developer privilege, you receive a DEV_TOKEN (scopes: user:read, develop, asset:read, asset:write, generate, llm). This token is issued by the Neta Developer Portal and provides full access to all platform APIs. You can use it to manage your developer apps (create, list, update, delete) via the CLI toolkit, or to call any platform API directly.
Your SPA issues its own tokens to end users with the scopes you registered for your app: user:read, asset:read, asset:write, generate, llm. SPA access tokens expire after 1 hour; a refresh token is included. Your client code is responsible for refreshing proactively to maintain a smooth user experience.
All users who sign in via Neta OAuth are automatically registered as Neta app users (or logged in if they already have an account).
Core workflow
- Register a developer app โ via the CLI toolkit (
bin/neta-dev-app) or the Neta Developer Portal
- Implement OAuth2 + PKCE โ against the Neta OAuth service at
https://auth.neta.art
- Request scopes โ match to the smallest set your app needs
- Call platform APIs โ with
Authorization: Bearer <access_token>
- Poll tasks โ for async generation results
If your SPA doesn't call Neta backend APIs, registration is optional.
Scope selection
| If your app needs to... | Request scope |
|---|
| Show user profile, avatar, AP balance | user:read |
| List or search characters, elementums, campaigns | asset:read |
| Create or update characters, elementums, campaigns | asset:write |
| Generate images, videos, songs, or upload media | generate |
| Stream LLM chat completions | llm |
Start with the smallest set. Update later via PATCH /v1/developer/apps/{uuid}.
The develop scope is reserved for the official portal. Third-party SPAs cannot request it.
Auth flow (OAuth2 + PKCE)
- Generate
code_verifier (512-bit entropy) and code_challenge (SHA-256)
- Redirect to
https://auth.neta.art/oidc/auth with client_id, redirect_uri, response_type=code, scope=openid offline_access <scopes>, code_challenge, code_challenge_method=S256, state, nonce, resource=https://api.talesofai
- Handle callback: validate
state, exchange code + code_verifier for tokens at https://auth.neta.art/oidc/token
- Validate
nonce in id_token payload
- Store tokens in
sessionStorage
- Refresh access token when within 60 seconds of expiry
Reference implementation: assets/demo-spa/auth.js.
Demo SPA quickstart
cp -r assets/demo-spa my-neta-app
cd my-neta-app
python3 -m http.server 9999
Zero-dependency vanilla JS covering all five scopes across 8 tabs. See assets/demo-spa/README.md for architecture, security model, and production hardening.
The demo is a reference starting point. For more ambitious projects, adapt it to any language or framework โ TypeScript, React, Vue, or your preferred stack. All auth and API logic is framework-agnostic.
Security
- No BFF: Tokens live in
sessionStorage only. SPA owners are responsible for securing their deployment. See demo README for XSS prevention patterns.
- CSP: Update the
<meta> tag in index.html when adding new hosts. See demo README for the CSP reference table.
- Redirect URI: Exactly 1 URI.
http://localhost:*, https://*.talesofai.com, or https://*.cohub.run. See references/developer-app-crud.md for the full rules table.
- Logout: Client-side only (
sessionStorage.clear() + reload). Tokens are not revoked at the OAuth service.
Adding API calls
Follow the namespaced pattern in api.js. Each scope maps to a namespace:
UserAPI.* โ profile, AP balance, delta history
AssetAPI.* โ characters, elementums, campaigns
GenerateAPI.* โ image/video/song generation, artifacts, upload, task polling
LLMAPI.* โ streaming chat completions
To add a new endpoint:
- Add a function to the appropriate namespace using the
callApi(method, path, body, query) helper
- Add UI in
index.html and wire logic in app.js
- Update CSP
connect-src / img-src / media-src if using new hosts
api.js is the source of truth for endpoint specs.
Glossary
Terms users may use, especially Chinese speakers:
| English | Chinese | Meaning |
|---|
| Neta | ๆTa | The platform (neta.art) |
| Character / OC | ่ง่ฒ / ๅๅ่ง่ฒ | A virtual character |
| Elementum | ๅ
็ด / ็ป้ฃๅ
็ด | Visual-style token controlling render style |
| TCP (Travel Character Parent) | ่ง่ฒ/ๅ
็ด ๅฎไฝๅบ็ฑป | Base API entity: character or elementum |
| VToken | โ | Virtual token referencing a character/elementum in generation prompts |
| Artifact | ไฝๅ | AI-generated output: image, video, or audio |
| AP (Action Points) | ็ต้ | Energy points consumed per generation |
| Campaign | ๆ
่ก / ๅ้ฉๆดปๅจ | Interactive adventure with AI DM roleplay |
| Scope | ๆ้่ๅด | OAuth scope controlling API access |
Resources
- Demo SPA reference:
assets/demo-spa/README.md โ architecture, security model, CSP guide, production checklist
- CLI toolkit:
references/developer-app-crud.md โ manage developer apps from the terminal
- API specs:
assets/demo-spa/api.js โ full endpoint listing (code is source of truth)
- Auth implementation:
assets/demo-spa/auth.js โ OAuth2 PKCE reference client