Skip to content

Commit 95d6d92

Browse files
Release infinitetalk SDK
Per-method documentation for all resource methods.
1 parent 84a10ec commit 95d6d92

27 files changed

Lines changed: 666 additions & 29 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ Use the most specific infinitetalk api variant page for pricing, rate limits, an
8080

8181
Default pricing link for the infinitetalk api SDK: https://runapi.ai/models/infinitetalk
8282

83+
## Generated file storage
84+
85+
RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
86+
8387
## FAQ
8488

8589
### Which package should I install for infinitetalk api work?

go/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ status, err := client.FromAudios.Get(context.Background(), task.ID)
2828

2929
Use `create` when you want to submit a task and return quickly, `get` when you need the latest task state, and `run` when a script should create and poll until completion. In web request handlers, prefer `create` plus webhook or later `get` polling so a worker is not held open.
3030

31+
RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
32+
3133
## Language notes
3234

3335
Use the public Go module with `github.com/runapi-ai/core-sdk/go` options when building video services, CLIs, or workers. The available resources include from audios. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.

go/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/runapi-ai/infinitetalk-sdk/go
22

33
go 1.26
44

5-
require github.com/runapi-ai/core-sdk/go v0.2.5
5+
require github.com/runapi-ai/core-sdk/go v0.2.6

go/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github.com/runapi-ai/core-sdk/go v0.2.5 h1:fYs9hl4yAlQj6N6J638tnOUBN+aiALmRxH4t0LfBOGw=
2-
github.com/runapi-ai/core-sdk/go v0.2.5/go.mod h1:e5uC8RF6BNkAj1WkOi+nD71mZL+cir+Ia97XUQj+5N0=
1+
github.com/runapi-ai/core-sdk/go v0.2.6 h1:wKlwZV2bJzV3N34wCCuQyNsHJmVFrsV1WvKhQex+P90=
2+
github.com/runapi-ai/core-sdk/go v0.2.6/go.mod h1:e5uC8RF6BNkAj1WkOi+nD71mZL+cir+Ia97XUQj+5N0=

go/infinitetalk/client.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@ package infinitetalk
1212
import (
1313
"context"
1414

15+
"github.com/runapi-ai/core-sdk/go/base"
1516
"github.com/runapi-ai/core-sdk/go/core"
1617
"github.com/runapi-ai/core-sdk/go/option"
1718
)
1819

1920
const audioToVideoPath = "/api/v1/infinitetalk/audio_to_video"
2021

22+
// Client provides access to InfiniteTalk lip-sync video generation.
2123
type Client struct {
24+
base.Base
2225
AudioToVideo *AudioToVideo
2326
}
2427

28+
// NewClient creates an InfiniteTalk client with the given options.
29+
// At minimum an API key is required (via option.WithAPIKey or the RUNAPI_API_KEY environment variable).
2530
func NewClient(opts ...option.ClientOption) (*Client, error) {
2631
resolved, err := option.ResolveClientOptions(opts...)
2732
if err != nil {
@@ -34,20 +39,31 @@ func NewClient(opts ...option.ClientOption) (*Client, error) {
3439
return NewClientWithHTTP(httpClient), nil
3540
}
3641

42+
// NewClientWithHTTP creates an InfiniteTalk client using a pre-configured HTTP client,
43+
// useful for shared connection pooling or custom transport settings.
3744
func NewClientWithHTTP(httpClient core.HTTPClient) *Client {
38-
return &Client{AudioToVideo: &AudioToVideo{http: httpClient}}
45+
return &Client{Base: base.New(httpClient), AudioToVideo: &AudioToVideo{http: httpClient}}
3946
}
4047

48+
// AudioToVideo generates lip-synced talking-head videos from a portrait image and an audio track.
49+
// The generated video shows the person speaking or singing in sync with the audio.
4150
type AudioToVideo struct{ http core.HTTPClient }
4251

52+
// Create submits an audio-to-video generation task and returns immediately with a task ID.
53+
// Use Get to poll for the result, or use Run for a blocking helper that polls automatically.
4354
func (r *AudioToVideo) Create(ctx context.Context, params AudioToVideoParams, opts ...option.RequestOption) (*core.TaskCreateResponse, error) {
4455
requestOptions, _ := option.ResolveRequestOptions(opts...)
4556
return core.PostJSON[core.TaskCreateResponse](ctx, r.http, audioToVideoPath, core.CompactParams(params), requestOptions)
4657
}
58+
59+
// Get retrieves the current status and result of an audio-to-video task by its ID.
4760
func (r *AudioToVideo) Get(ctx context.Context, id string, opts ...option.RequestOption) (*AudioToVideoResponse, error) {
4861
requestOptions, _ := option.ResolveRequestOptions(opts...)
4962
return core.GetJSON[AudioToVideoResponse](ctx, r.http, core.ResourcePath(audioToVideoPath, id), requestOptions)
5063
}
64+
65+
// Run submits an audio-to-video task and polls until it completes or fails, returning the final result.
66+
// This is a convenience wrapper around Create + Get polling. Use option.WithPollingInterval to adjust timing.
5167
func (r *AudioToVideo) Run(ctx context.Context, params AudioToVideoParams, opts ...option.RequestOption) (*AudioToVideoResponse, error) {
5268
_, pollingOptions := option.ResolveRequestOptions(opts...)
5369
return core.RunAsync(ctx, func(ctx context.Context) (*core.TaskCreateResponse, error) { return r.Create(ctx, params, opts...) }, func(ctx context.Context, id string) (*AudioToVideoResponse, error) { return r.Get(ctx, id, opts...) }, pollingOptions)

go/infinitetalk/types.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
package infinitetalk
22

3+
// AudioToVideoModel identifies which InfiniteTalk model variant to use for generation.
34
type AudioToVideoModel string
45

6+
// Resolution controls the output video dimensions.
57
type Resolution string
68

9+
// TaskStatus represents the processing state of an asynchronous generation task.
710
type TaskStatus string
811

912
const (
13+
// ModelAudioToVideo is the InfiniteTalk v1 model that generates lip-synced video
14+
// from a portrait image and audio track.
1015
ModelAudioToVideo AudioToVideoModel = "infinitetalk-from-audio"
11-
Resolution480P Resolution = "480p"
12-
Resolution720P Resolution = "720p"
16+
17+
// Resolution480P produces 480p output, faster to generate and lower cost.
18+
Resolution480P Resolution = "480p"
19+
// Resolution720P produces 720p output with higher visual fidelity.
20+
Resolution720P Resolution = "720p"
1321
)
1422

23+
// AsyncTaskResponse contains the common fields shared by all asynchronous task responses.
1524
type AsyncTaskResponse struct {
1625
ID string `json:"id"`
1726
Status TaskStatus `json:"status"`
@@ -22,15 +31,22 @@ func (r AsyncTaskResponse) GetID() string { return r.ID }
2231
func (r AsyncTaskResponse) GetStatus() string { return string(r.Status) }
2332
func (r AsyncTaskResponse) GetError() string { return r.Error }
2433

34+
// Video holds the URL of a generated video asset.
2535
type Video struct {
2636
URL string `json:"url"`
2737
}
2838

39+
// AudioToVideoResponse is the result of an audio-to-video generation task.
40+
// Once the task completes successfully, Videos contains the generated lip-synced video(s).
2941
type AudioToVideoResponse struct {
3042
AsyncTaskResponse
3143
Videos []Video `json:"videos,omitempty"`
3244
}
3345

46+
// AudioToVideoParams configures an audio-to-video lip-sync generation request.
47+
// Model, SourceImageURL, SourceAudioURL, and Prompt are all required.
48+
// The source image should be a clear frontal portrait; the audio track drives the lip movements
49+
// and determines the output video duration.
3450
type AudioToVideoParams struct {
3551
Model AudioToVideoModel `json:"model" help:"required; model slug"`
3652
SourceImageURL string `json:"source_image_url" help:"required; source image URL"`

js/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ const status = await client.fromAudios.get(task.id);
2424

2525
Use `create` when you want to submit a task and return quickly, `get` when you need the latest task state, and `run` when a script should create and poll until completion. In web request handlers, prefer `create` plus webhook or later `get` polling so a worker is not held open.
2626

27+
RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
28+
2729
## Language notes
2830

2931
Use the TypeScript types in `src/types.ts` and the resource classes under `src/resources` when building video applications. The available resources include from audios. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.

js/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@runapi.ai/infinitetalk",
3-
"version": "0.2.5",
3+
"version": "0.2.6",
44
"description": "RunAPI InfiniteTalk SDK for JavaScript, Ruby, and Go",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",
@@ -28,7 +28,7 @@
2828
"clean": "rm -rf dist"
2929
},
3030
"dependencies": {
31-
"@runapi.ai/core": "^0.2.5"
31+
"@runapi.ai/core": "^0.2.6"
3232
},
3333
"devDependencies": {
3434
"@types/node": "^20.0.0",

js/skills/infinitetalk/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ const url = result.videos[0].url;
7070

7171
## Agent rules
7272

73+
- Integration work uses the target language SDK; one-off generation, manual smoke tests, debugging, or user-requested CLI runs use the RunAPI CLI skill: https://github.com/runapi-ai/cli-skill
74+
- RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
7375
- Keep API keys in `RUNAPI_API_KEY` or RunAPI CLI config; never commit secrets.
7476
- Prefer `create`, `get`, and `run` JSON passthrough patterns instead of inventing flags for every model parameter.
7577
- For infinitetalk api pricing, rate-limit, and commercial-usage answers, link to the model page rather than the repository README.

js/skills/infinitetalk/SKILL.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,23 @@ metadata:
2525

2626
Generate and edit video with InfiniteTalk through RunAPI. The default path for one-off agent tasks is the `runapi` CLI; SDKs are for application integration.
2727

28-
## Routing decision
28+
## Critical: Integration Runtime
2929

30-
- One-off generation, editing, or transformation for the user → use the **CLI path** with the `runapi` binary.
31-
- Building an app, backend, worker, library, or production codebase → use the **SDK integration path**.
30+
- Integration work (app, backend, worker, library, Rails service, Node service, Go service, webhook pipeline, or production codebase) uses the **SDK integration path** for the target language.
31+
- One-off generation, editing, transformation, manual smoke tests, debugging, or user-requested CLI runs use the **CLI path** with the `runapi` binary. For full CLI-specific agent guidance, see https://github.com/runapi-ai/cli-skill.
32+
- Never shell out to the `runapi` CLI as the production runtime integration layer.
33+
34+
## SDK integration path
35+
36+
When integrating InfiniteTalk into an app, backend, worker, library, Rails service, Node service, Go service, webhook pipeline, or production workflow, start by checking the current SDK package and official usage. Confirm install commands, client methods (`create`, `get`, `run`), request fields, response shape, and error classes before using CLI help or raw HTTP examples. Use a RunAPI SDK package:
37+
38+
- JavaScript / TypeScript: `@runapi.ai/infinitetalk`
39+
- Ruby: `runapi-infinitetalk`
40+
- Go: `github.com/runapi-ai/infinitetalk-sdk/go`
3241

3342
## CLI path
3443

35-
The `runapi` binary is the runtime dependency. Run `runapi auth status` first. For agents and headless runs, prefer `RUNAPI_API_KEY` or import it into saved config with `printf '%s' "$RUNAPI_API_KEY" | runapi auth import-token --token -`. Use `runapi login` only when the user explicitly wants interactive browser auth.
44+
The `runapi` binary is the one-off and manual testing runtime dependency. For full CLI-specific agent guidance, see https://github.com/runapi-ai/cli-skill. Run `runapi auth status` first. For agents and headless runs, prefer `RUNAPI_API_KEY` or import it into saved config with `printf '%s' "$RUNAPI_API_KEY" | runapi auth import-token --token -`. Use `runapi login` only when the user explicitly wants interactive browser auth.
3645

3746
Inspect the available commands and request fields with CLI help:
3847

@@ -56,13 +65,9 @@ runapi wait <task-id> --service infinitetalk --action audio-to-video
5665

5766
Available commands: `audio-to-video`.
5867

59-
## SDK integration path
60-
61-
When integrating InfiniteTalk into an app, backend, worker, or library — not for one-off tasks — use a RunAPI SDK package:
68+
## Generated file storage
6269

63-
- JavaScript / TypeScript: `@runapi.ai/infinitetalk`
64-
- Ruby: `runapi-infinitetalk`
65-
- Go: `github.com/runapi-ai/infinitetalk-sdk/go`
70+
RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
6671

6772
## References
6873

0 commit comments

Comments
 (0)