Communitygithub.com

evalix098/tiktoklive

이 앱의 서버 코드에 주입된 XAI_API_KEY를 사용하여 xAI API(Grok)를 호출합니다: 채팅/LLM 기능, 이미지 및 비디오 생성(Imagine), 음성(텍스트 음성 변환)을 제공합니다. 앱에 'AI', '어시스턴트', '챗봇', 'Grok' 기능, 런타임 이미지/비디오 생성 또는 음성 기능이 필요할 때 사용하세요.

tiktoklive란 무엇인가요?

이 스킬은 앱의 서버 코드에서 환경 변수로 주입된 `XAI_API_KEY`를 통해 xAI API(Grok)에 직접 접근할 수 있게 해줍니다. 채팅/LLM(Grok-4.5 모델), 이미지 및 비디오 생성(Imagine API), 텍스트 음성 변환(Voice API) 등 xAI의 전체 API 표면을 사용할 수 있어, AI 기능을 모의 응답이나 타사 제공자 없이 실제로 구현할 수 있습니다. API는 OpenAI와 호환되므로(`https://api.x.ai/v1`), 기존 OpenAI 스타일 클라이언트에서 기본 URL과 키만 변경하여 사용할 수 있습니다. 이 스킬은 특히 클라이언트가 아닌 서버 전용 코드에서 안전하게 호출되도록 설계되었으며, API 키 노출을 방지하기 위해 서버 함수 내에서만 사용해야 합니다. 또한, 키는 앱 소유자의 개인 키이므로 호출 시 할당량과 크레딧이 소모되므로, 사용자 요청에 의해서만 호출하고 결과를 캐싱하거나 지속하는 등 비용을 신중하게 관리해야 합니다. 다양한 플랫폼(TanStack Start 기반 앱 등)에서 사용할 수 있으며, SKILL.md 문서에 상세한 사용법과 주의사항이 설명되어 있습니다.

지원 대상~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/evalix098/tiktoklive/tree/HEAD/.grok/skills/xai-api

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

xAI API (Grok)

환경에 XAI_API_KEY가 있으면 이 앱은 실제 xAI API에 접근할 수 있습니다—AI 기능을 위해 모의 응답을 만들거나 다른 제공자를 찾는 대신 사용하세요. 동일한 변수는 배포된 앱에도 게시 시 주입되므로, 이를 기반으로 작성된 코드는 프리뷰와 프로덕션에서 동일하게 작동합니다.

키는 앱 소유자의 개인 키입니다: 모든 호출은 그들의 할당량과 크레딧을 소모합니다. 사용에 신중해야 합니다—자동으로 실행되거나 방문자에게 열려 있는 모든 것에 AI 호출을 연결하기 전에 비용 책임을 참조하세요.

키는 채팅뿐만 아니라 전체 API 표면을 잠금 해제합니다:

  • 채팅 / LLM — 최신 모델: grok-4.5; 사용자가 달리 요청하지 않는 한 기본값으로 사용하세요.
  • 이매진(이미지 및 비디오) — 앱 내에서 런타임에 이미지 생성 및 편집, 비디오 생성.
  • 음성 — 표현력 있는 음성으로 텍스트 음성 변환(및 전사).
  • 공식 문서: docs.x.ai — 엔드포인트, 모델, 파라미터, 스트리밍, 도구 사용. API 형태를 추측하지 말고 문서를 확인하세요.
  • API는 OpenAI 호환(https://api.x.ai/v1)이므로, 기본 URL과 키만 변경하면 모든 OpenAI 스타일 클라이언트가 작동합니다.

환경 변수 — .env 파일을 생성하지 마세요

변수위치목적
XAI_API_KEY서버플랫폼(프리뷰 및 배포)에서 주입됩니다. 절대 작성, 하드코딩 또는 사용자에게 요청하지 마세요.

키는 서버 전용입니다: createServerFn 핸들러 / 서버 코드 내에서 process.env.XAI_API_KEY로 읽고, 클라이언트 컴포넌트에서는 절대 사용하지 말고, VITE_ 접두사 변수나 API 응답을 통해 노출하지 마세요.

키가 없을 수 있습니다(롤아웃 제한). 정상적으로 저하 처리하세요—키를 확인하고 충돌 대신 "AI 기능을 사용할 수 없습니다"라는 친숙한 상태를 표시하세요:

const apiKey = process.env.XAI_API_KEY;
if (!apiKey) throw new Error("이 환경에서는 AI를 사용할 수 없습니다");

API 호출 (서버 전용)

SDK가 필요 없습니다—서버 함수에서 일반 fetch를 사용하세요:

import { createServerFn } from "@tanstack/react-start";

export const askGrok = createServerFn({ method: "POST" })
  .validator((input: { prompt: string }) => input)
  .handler(async ({ data }) => {
    const apiKey = process.env.XAI_API_KEY;
    if (!apiKey) return { ok: false as const, error: "AI를 사용할 수 없습니다" };

    const res = await fetch("https://api.x.ai/v1/chat/completions", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Authorization: `Bearer ${apiKey}`,
      },
      body: JSON.stringify({
        model: "grok-4.5",
        messages: [{ role: "user", content: data.prompt }],
      }),
    });
    if (!res.ok) {
      return { ok: false as const, error: `xAI API 오류 ${res.status}` };
    }
    const body = (await res.json()) as {
      choices: { message: { content: string } }[];
    };
    return { ok: true as const, text: body.choices[0]?.message.content ?? "" };
  });

스트리밍, 구조화된 출력, 비전 또는 전체 모델 목록은 docs.x.ai를 따르세요—형태는 OpenAI 호환입니다.

이매진 — 이미지 및 비디오 생성 (서버 전용)

동일한 키가 앱 내에서 런타임 이미지/비디오 기능(사용자 아바타, 씬 아트, 생성된 콘텐츠)을 구동합니다. 빌드 시 imagine_text_to_image / imagine_image_to_image / imagine_image_to_video 도구(imagine-grok-build 스킬)와는 다릅니다: API는 실행 중인 앱이 미디어를 생성할 때 사용하고, 도구는 당신이 빌드하는 동안 정적 자산을 만들 때 사용하세요.

// POST https://api.x.ai/v1/images/generations — 채팅과 동일한 인증 헤더
body: JSON.stringify({
  model: "grok-imagine-image-quality", // 또는 "grok-imagine-image" (더 저렴)
  prompt: data.prompt,
  // n (≤10), resolution ("1k"|"2k"), response_format ("url"|"b64_json")
})
// → body.data[0].url
  • 이미지 편집: POST /v1/images/edits — 자연어 편집, 최대 3개의 참조 이미지.
  • 비디오: grok-imagine-video를 비동기 비디오 엔드포인트(시작 후 반환된 요청 ID를 폴링, 클립 최대 ~15초)를 통해 사용.
  • 전체 파라미터 및 예제: docs.x.ai → Imagine API.

음성 — 텍스트 음성 변환 (서버 전용)

POST https://api.x.ai/v1/tts는 텍스트를 음성 오디오(내레이션, 접근성, 캐릭터 음성)로 변환합니다:

// 동일한 Authorization 헤더; 오디오 바이트(예: MP3) 반환
body: JSON.stringify({ text: data.text, voice_id: "eve" }) // eve = 기본 음성

GET /v1/tts/voices에서 음성 목록 확인(사용자 정의 음성 지원); 전사(음성-텍스트)도 가능합니다. 자세한 내용: docs.x.ai → Voice API. 서버 함수에서 클라이언트로 오디오를 제공하세요—브라우저에서 API를 호출하지 마세요(키가 노출됩니다).

비용 책임

키는 앱 소유자(당신이 빌드하는 사용자)의 것입니다: 모든 호출(배포된 앱의 익명 방문자가 트리거한 호출 포함)은 그들의 개인 할당량과 크레딧을 소모합니다. 낭비적인 호출에 사용하면 다른 모든 키 사용이 저하되거나 중단됩니다. 사용에 주의하세요:

  • 방문자 대상 기능의 경우 출력 크기(max_tokens)를 제한하고 프롬프트를 작게 유지하세요. 특히 비디오 생성은 채팅보다 호출당 비용이 훨씬 더 많이 듭니다.
  • 루프, 모든 키 입력, 페이지 로드 시 API를 호출하지 마세요—사용자 시작(버튼 누름, 양식 제출)으로 호출하고 디바운스하세요.
  • 방문자나 렌더링마다 동일한 콘텐츠를 재생성하는 대신 결과를 캐싱하거나 지속하세요(neon 스킬 참조).
  • 비용이 많이 드는 흐름은 제한하세요—특히 미디어 생성. 이미 로그인이 있는 앱의 경우 authMiddleware 뒤에 두세요(auth 스킬 참조). 로그인은 기본적으로 꺼져 있으며, 미들웨어를 추가하면 배포된 앱이 중단됩니다(AGENTS.md §0.5) — 따라서 계정이 없는 앱에서는 사용량을 제한하세요: 사용자 시작 호출, 작은 제한, 캐시된 결과.
  • 재시도 폭풍을 추가하지 마세요: API 오류가 발생하면 표시하고, 최대 한 번만 재시도하세요.

Individual skills in this repo

This repo contains 17 individual skills — each has its own dedicated page.

evalix098/tiktoklive

Add user accounts and sign-in to this TanStack Start app. Use when the app needs authentication, sign-in, user accounts, protected routes, or per-user data. Triggers on "auth", "login", "log in", "sign in", "sign up", "account", "users", "authentication", "protected", "who is logged in", "current user", "per-user".

evalix098/tiktoklive

Build browser games and interactive/canvas/3D experiences in this TanStack Start + React app. Use for any game, simulation, or WebGL/Canvas experience — 2D or 3D, single-player. Covers the game loop & timing, 3D orientation/camera conventions, collision, performance, assets, audio, save, game feel, and per-genre playbooks. For WASD / vehicle / flight **input signs and inverted A/D**, open the **`controls`** skill — do not rely on this file or racing-kart alone. Triggers on "game", "minecraft", "fps", "platformer", "racing", "tetris", "snake", "shooter", "3d", "three.js", "canvas", "voxel", "physics".

evalix098/tiktoklive

Player-facing input signs for browser games: WASD, vehicles, flight, FPS mouse-look, and the #1 failure mode (inverted A/D). Mandatory control self-tests and a tiny test interface so you can verify A turns left before shipping. Load for ANY game with movement, steering, flying, driving, tanks, boats, mechs, drones, planes, karts, third-person follow cams — not only racing. Triggers on "controls", "WASD", "inverted", "steer", "flight", "airplane", "kart", "vehicle", "yaw", "roll", "pitch", "mouse look", "A/D".

evalix098/tiktoklive

Design and build polished, non-generic UI for this TanStack Start + React + Tailwind v4 + shadcn/Radix app. Use whenever you create or restyle any interface surface — pages, landing pages, dashboards, forms, modals, nav, and game overlays (start screens, HUD, menus). Covers design tokens, layout, typography, color, spacing, motion, and the anti-"AI-slop" rules that keep output from looking generic. Triggers on "design", "UI", "make it look good", "polish", "landing page", "theme", "style", "redesign", "ugly", "clean up".

evalix098/tiktoklive

Deep guide for game ANIMATION assets: motion cycles, action keyframes, effect sequences, and animation sprite sheets — built around a video-first pipeline. In this app-builder sandbox, execute via the video2dsprite / generate2dsprite skills (magenta + scripts), not ad-hoc ffmpeg. Use whenever generating anything that moves: walk/run cycles, attacks, idles, FX, flags, fire, animation sheets. Complements game-asset-core.

evalix098/tiktoklive

Core discipline for ANY game-asset generation with Imagine tools: the engine-ready defaults users don't state, spec checklists, style anchoring, read-back verification, honest defect flagging. Use whenever generating any game art (sprites, sheets, animations, tiles, UI, FX) — then ALSO load the matching specialist skill: game-animation-frames for anything that moves, game-tilesets for tiles/terrain, game-character-consistency for recurring characters, game-ui-icons for UI and icons.

evalix098/tiktoklive

Deep guide for CHARACTER IDENTITY across images: turnarounds (front/side/ back), state and damage variants, palette swaps, equipment changes, and same-character-in-context sets. Use whenever generating character turnarounds, character sheets, variants of an existing sprite, or any same-subject multi-image set. Complements game-asset-core.

evalix098/tiktoklive

Deep guide for game TILE assets: seamless tileable textures, terrain transition tilesets, autotiles, and ground/platform tiles. Use whenever generating tileable textures, tilesets, terrain transitions, or seamless patterns. Complements game-asset-core.

evalix098/tiktoklive

Deep guide for game UI assets: buttons with interaction states, panels, bars, wordmark logos, and icon sets. Use whenever generating game UI elements, HUD assets, inventory icons, icon sets, buttons, or title logos. Complements game-asset-core.

evalix098/tiktoklive

Generate production-oriented 2D game maps with `imagine_text_to_image`: RPG/top-down maps, side-scroller parallax stages, tilemaps, layered raster maps, prop packs, collision zones, and walkable areas. Use when building browser games that need real map art (not pure code-drawn tiles), layered props, or map collision metadata. Triggers on "map", "level", "stage", "tilemap", "overworld", "dungeon", "side scroller background", "prop pack", "2D map".

evalix098/tiktoklive

Generate and postprocess 2D game sprites and animation sheets: pixel-art characters, NPCs, creatures, spells, projectiles, impacts, props, summons, and transparent PNG/GIF exports. Use when building browser games that need real sprite sheets (not code-drawn placeholders), matching a map art style, or producing magenta-background sheets for chroma-key cleanup. Triggers on "sprite", "sprite sheet", "animation sheet", "pixel art character", "walk cycle", "attack animation", "projectile sprite", "2D game asset".

evalix098/tiktoklive

How to use the Imagine tools in Grok Build: imagine_text_to_image, imagine_image_to_image, imagine_reference_to_image, imagine_text_to_video, imagine_image_to_video, imagine_reference_to_video, and render_file for chat previews. When to build a visual with code instead of generating it, prompt-craft, reference-first handling of real people, factual grounding, and asset-consistency. Load this whenever generating or editing an image or video is on the table. Tool-usage-driven, not triggered by a user merely mentioning images.

evalix098/tiktoklive

Peer-to-peer realtime multiplayer over WebRTC data channels: every user of the deployed app connects directly to every other user (full mesh), the server only brokers the handshake at /api/rtc. Lowest possible latency, zero per-message server cost. Use for 2-8 player co-op/casual realtime: shared cursors, drawing, party games, casual action. Triggers: p2p, peer to peer, webrtc, low latency multiplayer, direct connection.

evalix098/tiktoklive

Use Neon Postgres (the database) in this TanStack Start app. Use when the app needs to store or query data, persist state, or keep per-user data. Triggers on "database", "Postgres", "Neon", "save data", "store data", "persist", "tables", "SQL", "query", "migrations".

evalix098/tiktoklive

Share-link previews and app identity for apps on *.grok.me: the injector-owned og:image card, the SVG favicon, and PWA icons for installable apps. Use when scaffolding, renaming, or restyling the app — and for share / unfurl / OG / Twitter card questions. A custom 1200×630 card from the app's own art is the default — games of every kind (DOM board/word games included), whimsical apps, creative tools, and brand-forward pages; only plain utilities keep the placeholder. Always run the brand-asset pass as a `task` subagent and never wait for it. Triggers on "share", "rename", "app name", "OG", "Open Graph", "twitter card", "unfurl", "og:image", "og:type", "x:game:image", "x-banner", "link preview", "social card", "thumbnail", "preview image", "favicon", "app icon", "PWA", "manifest", "installable", "home screen", "SEO", "meta description".

evalix098/tiktoklive

Official Three.js API and TSL (Three.js Shading Language) reference for LLM code generation. Load when writing or debugging three.js / WebGL / WebGPU / custom materials / shaders / GLTF / advanced three APIs beyond basic game loop/controls. Prefer building-games for game correctness (loop, WASD, camera, orientation); use this skill for full API/TSL depth. Triggers on "three.js", "threejs", "WebGPU", "TSL", "NodeMaterial", "shader", "GLTF", "MeshStandard", "OrbitControls", "WebGLRenderer".

evalix098/tiktoklive

Grok Build only. Turn a 2D character still into denser animation sprites via imagine_text_to_image base → imagine_image_to_video (6s/10s run-in-place) → ffmpeg frames → magenta chroma-key → dense sampled strips/grids/GIFs. Use when the user wants video-to-sprite, smoother run/walk cycles, or denser intermediate poses. Prefer generate2dsprite for crisp production pixel sheets. Triggers on "video to sprite", "imagine_image_to_video sprite", "dense walk cycle", "smooth run animation from video".

관련 스킬