How to create a prism using the API
Use add primitive cylinder to make a prism

Basically by definition a cylinder in blender is really a regular ngon prism.  Therefore, to add a prism via the UI, simply add &gt; mesh &gt; cylinder with the amount of sides you want the ngon end to have. For example for a triangular prism



This is a simple call to the  operator:

bpy.ops.mesh.primitive_cylinder_add(vertices=3)


change the value of vertices to make other ngons on the ends of prism.

And via the bmesh API with bmesh.ops.create_cone   

Rather than having a create cylinder bmesh has a create cone, which allows us to create a prism by setting the end radii the same.  Simple code to add a triangular prism.

import bpy
import bmesh
context = bpy.context
bm = bmesh.new()
bmesh.ops.create_cone(bm, 
        cap_ends=True, 
        cap_tris=False, 
        segments=3, 
        diameter1=1, 
        diameter2=1, 
        depth=2)
mesh = bpy.data.meshes.new("Prism")
bm.to_mesh(mesh)
prism = bpy.data.objects.new("Prism", mesh)
# link to scene
context.scene.objects.link(prism)