π Introducing MARS8 Series β Four Powerful Variants | Available on All Major Clouds | Learn about the model here
π Introducing MARS8 Series β Four Powerful Variants | Available on All Major Clouds | Learn about the model here
Access completed story conversion outputs and transcripts using the unique run identifier
curl --request GET \
--url https://client.camb.ai/apis/story-result/{run_id} \
--header 'x-api-key: <api-key>'{
"audio_url": "<string>",
"dialogue_url": "<string>",
"transcript": [
{
"start": 123,
"end": 123,
"text": "<string>",
"speaker": "<string>"
}
]
}Obtain the final products of your story conversion process through this endpoint. When a story generation task completes successfully, this endpoint provides direct access to the produced audio files and optional textual transcript - enabling immediate integration into audiobook platforms, content management systems, or interactive storytelling applications.Documentation Index
Fetch the complete documentation index at: https://docs.camb.ai/llms.txt
Use this file to discover all available pages before exploring further.
audio_url)
dialogue_url)
include_transcript query parameterimport requests
def fetch_story_assets(run_id, include_transcript=False):
"""
Retrieves story conversion outputs with optional transcript
Args:
run_id: Unique identifier from story processing task
include_transcript: Whether to return narrative transcript
Returns:
Dict containing audio URLs and optional transcript
"""
headers = {
"x-api-key": "your-api-key",
"Content-Type": "application/json"
}
params = {"include_transcript": str(include_transcript).lower()}
try:
response = requests.get(
f"https://client.camb.ai/apis/story-result/{run_id}",
headers=headers,
params=params
)
response.raise_for_status()
result = response.json()
print(f"Retrieved story assets for Run ID: {run_id}")
return result
except requests.exceptions.HTTPError as e:
print(f"Error {e.response.status_code}: {e.response.text}")
return None
# Example usage with transcript request
story_data = fetch_story_assets(
run_id=9872, # Replace with your actual run ID.
include_transcript=True
)
if story_data:
print(f"Main Audio: {story_data['audio_url']}")
print(f"Dialogue Track: {story_data['dialogue_url']}")
if story_data.get('transcript'):
print(f"\nTranscript Preview:")
for entry in story_data['transcript'][:2]:
print(f"[{entry['start']}-{entry['end']}ms] {entry['speaker']}: {entry['text']}")
The x-api-key is a custom header required for authenticating requests to our API. Include this header in your request with the appropriate API key value to securely access our endpoints. You can find your API key(s) in the 'API' section of our studio website.
The unique identifier for the run, which was generated during the creation process and returned upon task completion.
The optional include_transcript query parameter determines whether the detailed transcript data should be included in the response.
Successful Response
The URL pointing to the generated audio file for the story.
The URL pointing to the audio file that contains the story's dialogue.
A collection of dialogue items representing the textual transcript of the story.
Hide child attributes
The start time (in seconds) of the dialogue.
The end time (in seconds) of the dialogue.
The actual text content of the dialogue spoken by the speaker.
The name or identifier of the speaker delivering the dialogue.
curl --request GET \
--url https://client.camb.ai/apis/story-result/{run_id} \
--header 'x-api-key: <api-key>'{
"audio_url": "<string>",
"dialogue_url": "<string>",
"transcript": [
{
"start": 123,
"end": 123,
"text": "<string>",
"speaker": "<string>"
}
]
}